Flutter Engine
The Flutter Engine
Instance Methods | Class Methods | Properties | List of all members
FlutterError Class Reference

#import <FlutterCodecs.h>

Inheritance diagram for FlutterError:

Instance Methods

(instancetype) - initWithCode:message:details: [implementation]
 
(BOOL- isEqual: [implementation]
 
(NSUInteger) - hash [implementation]
 

Class Methods

(instancetype) + errorWithCode:message:details:
 
(instancetype) + errorWithCode:message:details: [implementation]
 

Properties

NSString * code
 
NSString * message
 
id details
 

Detailed Description

Error object representing an unsuccessful outcome of invoking a method on a FlutterMethodChannel, or an error event on a FlutterEventChannel.

Definition at line 246 of file FlutterCodecs.h.

Method Documentation

◆ errorWithCode:message:details: [1/2]

+ (instancetype) errorWithCode: (NSString*)  code
message: (NSString*)  message
details: (id details 
implementation

Definition at line 73 of file FlutterChannels.mm.

172 :(NSString*)code message:(NSString*)message details:(id)details {
173 return [[FlutterError alloc] initWithCode:code message:message details:details];
174}
NSString * message
NSString * code
const uintptr_t id

◆ errorWithCode:message:details: [2/2]

+ (instancetype) errorWithCode: (NSString *)  code
message: (NSString *_Nullable)  message
details: (id _Nullable)  details 

Creates a FlutterError with the specified error code, message, and details.

Parameters
codeAn error code string for programmatic use.
messageA human-readable error message.
detailsCustom error details.

◆ hash

- (NSUInteger) hash
implementation

Definition at line 73 of file FlutterChannels.mm.

199 {
200 return [self.code hash] ^ [self.message hash] ^ [self.details hash];
201}

◆ initWithCode:message:details:

- (instancetype) initWithCode: (NSString*)  code
message: (NSString*)  message
details: (id details 
implementation

Definition at line 73 of file FlutterChannels.mm.

176 :(NSString*)code message:(NSString*)message details:(id)details {
177 NSAssert(code, @"Code cannot be nil");
178 self = [super init];
179 NSAssert(self, @"Super init cannot be nil");
180 _code = [code copy];
181 _message = [message copy];
182 _details = details;
183 return self;
184}

◆ isEqual:

- (BOOL) isEqual: (id object
implementation

Definition at line 73 of file FlutterChannels.mm.

186 :(id)object {
187 if (self == object) {
188 return YES;
189 }
190 if (![object isKindOfClass:[FlutterError class]]) {
191 return NO;
192 }
193 FlutterError* other = (FlutterError*)object;
194 return [self.code isEqual:other.code] &&
195 ((!self.message && !other.message) || [self.message isEqual:other.message]) &&
196 ((!self.details && !other.details) || [self.details isEqual:other.details]);
197}

Property Documentation

◆ code

- (NSString*) code
readnonatomicassign

The error code.

Definition at line 260 of file FlutterCodecs.h.

◆ details

- (id) details
readnonatomicassign

The error details.

Definition at line 270 of file FlutterCodecs.h.

◆ message

- (NSString*) message
readnonatomicassign

The error message.

Definition at line 265 of file FlutterCodecs.h.


The documentation for this class was generated from the following files: