getErrorMessage function

String getErrorMessage(
  1. dynamic error
)

Implementation

String getErrorMessage(dynamic error) {
  String? message;
  if (error is JsObject) {
    message = error["message"]?.toString() ?? error.toString();
  }
  return message ?? error.toString();
}