Skip to content

Commit

Permalink
Merge branch 'main' into rfw
Browse files Browse the repository at this point in the history
  • Loading branch information
Hixie authored Jul 12, 2023
2 parents dd82675 + 1999cdc commit 9e42394
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
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',
);
});
}

0 comments on commit 9e42394

Please sign in to comment.