getErrorCodesFromError function

ErrorCodes? getErrorCodesFromError(
  1. dynamic error
)

Returns the error codes from error.

Implementation

ErrorCodes? getErrorCodesFromError(dynamic error) {
  if (error is ErrorCodes) {
    return error;
  } else if (error is PlatformException) {
    PlatformException pe = error;
    return getErrorCodesFromString(pe.code);
  }

  return getErrorCodesFromString(error.toString());
}