reportError method
Report an error through the error handler with optional source span.
Implementation
void reportError(String message, {SourceSpan? span}) {
if (errorHandler != null) {
errorHandler!.handleError(message, this, span: span);
}
}