Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.6.3

* Introduces `NSError.toString` for better diagnostics.

## 3.6.2

* Fixes unawaited_futures violations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,22 @@ class NSError {

/// The error code.
///
/// Note that errors are domain-specific.
/// Error codes are [domain]-specific.
final int code;

/// A string containing the error domain.
final String domain;

/// A string containing the localized description of the error.
final String localizedDescription;

@override
String toString() {
if (localizedDescription.isEmpty) {
return 'Error $domain:$code';
}
return '$localizedDescription ($domain:$code)';
}
}

/// A representation of an HTTP cookie.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: webview_flutter_wkwebview
description: A Flutter plugin that provides a WebView widget based on Apple's WKWebView control.
repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_wkwebview
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
version: 3.6.2
version: 3.6.3

environment:
sdk: ">=2.18.0 <4.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,39 @@ void main() {
});
});
});

test('NSError', () {
expect(
const NSError(
code: 0,
domain: 'domain',
localizedDescription: 'desc',
).toString(),
'desc (domain:0)',
);
expect(
const NSError(
code: 0,
domain: 'domain',
localizedDescription: '',
).toString(),
'Error domain:0',
);
expect(
const NSError(
code: 255,
domain: 'bar',
localizedDescription: 'baz',
).toString(),
'baz (bar:255)',
);
expect(
const NSError(
code: 255,
domain: 'bar',
localizedDescription: '',
).toString(),
'Error bar:255',
);
});
}