Skip to content

Commit

Permalink
feat: Add throwException handler
Browse files Browse the repository at this point in the history
  • Loading branch information
littleGnAl committed Aug 12, 2024
1 parent 1a240fa commit 86d3f67
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/src/iris_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 86d3f67

Please sign in to comment.