Skip to content
This repository was archived by the owner on Oct 5, 2020. It is now read-only.

Commit 64382f9

Browse files
committed
Use handleError for setConfig
1 parent 7ec8a20 commit 64382f9

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'io.chirp.chirp_flutter'
2-
version '1.0-SNAPSHOT'
2+
version '1.0'
33

44
buildscript {
55
ext.kotlin_version = '1.3.50'

ios/Classes/ChirpFlutterPlugin.m

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,10 @@ - (void)setConfig:(FlutterMethodCall*)call result:(FlutterResult)result {
138138
if (![self isInitialised:call result:result]) return;
139139
NSString *config = call.arguments;
140140
NSError *error = [self.chirp setConfig:config];
141-
if (error) {
142-
result([FlutterError errorWithCode:[NSString stringWithFormat:@"%ld", (long)error.code]
143-
message:error.localizedDescription
144-
details:nil]);
145-
} else {
141+
if (!error) {
146142
[self setCallbacks];
147-
result(nil);
148143
}
144+
[self handleError:call result:result withError:error];
149145
}
150146

151147
- (void)start:(FlutterMethodCall*)call result:(FlutterResult)result {

0 commit comments

Comments
 (0)