diff --git a/lib/src/iris_method_channel.dart b/lib/src/iris_method_channel.dart index 00ded2f..dd8984a 100644 --- a/lib/src/iris_method_channel.dart +++ b/lib/src/iris_method_channel.dart @@ -9,6 +9,19 @@ import 'package:iris_method_channel/src/platform/iris_method_channel_internal.da // ignore_for_file: public_member_api_docs +@pragma('vm:prefer-inline') +ThrowExceptionHandler throwException = _defaultThrowExceptionBuilder; +@pragma('vm:prefer-inline') +void _defaultThrowExceptionBuilder({required int code, String? message}) { + throw Exception(); +} + +typedef ExceptionBuilder = Exception Function( + {required int code, String? message}); + +typedef ThrowExceptionHandler = void Function( + {required int code, String? message}); + class IrisMethodChannel { IrisMethodChannel(this._nativeBindingsProvider) { _irisMethodChannelInternal =