set abstract method
Sets error
to lastError, and then calls all the registered
listeners with the error passed in, along with related information
if provided.
Implementation
void set(T error, [Object? exception, StackTrace? stack, Object? context]);