Formats the error message with the error code.
String format([String? details]) => details != null ? '$details [${qname.stringValue}]' : '$message [${qname.stringValue}]';