fromException static method

SyneriseError fromException(
  1. PlatformException exception
)

Implementation

static SyneriseError fromException(PlatformException exception) {
  int code;
  try {
    code = int.parse(exception.code);
  } on FormatException {
    code = defaultUnknownErrorCode;
  }
  String? message = exception.message;

  return SyneriseError(code, message ?? 'No error message provided',
      details: exception.details, stacktrace: exception.stacktrace);
}