mirror of
https://github.com/dart-lang/sdk
synced 2024-10-02 23:49:17 +00:00
Remove deprecated APIs from dart:developer
Contributes to bug: https://github.com/dart-lang/sdk/issues/34233 Change-Id: I18f12b8c8da2ec444911128b96111e93df6c0496 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251767 Commit-Queue: Michael Thomsen <mit@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
09680ec704
commit
e15d639827
|
@ -2489,6 +2489,15 @@ breaking changes:
|
|||
|
||||
#### `dart:developer`
|
||||
|
||||
- **Breaking change** [#34233][]: The previously deprecated APIs
|
||||
`kInvalidParams`, `kExtensionError`, `kExtensionErrorMax`, and
|
||||
`kExtensionErrorMin` in [`ServiceExtensionResponse`][] have been removed. They
|
||||
have been replaced by `invalidParams`, `extensionError`, `extensionErrorMax`,
|
||||
and `extensionErrorMin`.
|
||||
|
||||
[#34233]: https://github.com/dart-lang/sdk/issues/34233
|
||||
[`ServiceExtensionResponse`]: https://api.dart.dev/stable/dart-developer/ServiceExtensionResponse-class.html#constants
|
||||
|
||||
- The constructors for `TimelineTask` now accept an optional `filterKey`
|
||||
parameter. If provided, the arguments for all events associated with the task
|
||||
will contain an entry named `filterKey`, set to the value of the `filterKey`
|
||||
|
|
|
@ -88,13 +88,13 @@ _runExtension(
|
|||
} catch (e, st) {
|
||||
var errorDetails = (st == null) ? '$e' : '$e\n$st';
|
||||
response = new ServiceExtensionResponse.error(
|
||||
ServiceExtensionResponse.kExtensionError, errorDetails);
|
||||
ServiceExtensionResponse.extensionError, errorDetails);
|
||||
_postResponse(replyPort, id, response, trace_service);
|
||||
return;
|
||||
}
|
||||
if (response is! Future) {
|
||||
response = new ServiceExtensionResponse.error(
|
||||
ServiceExtensionResponse.kExtensionError,
|
||||
ServiceExtensionResponse.extensionError,
|
||||
"Extension handler must return a Future");
|
||||
_postResponse(replyPort, id, response, trace_service);
|
||||
return;
|
||||
|
@ -103,13 +103,13 @@ _runExtension(
|
|||
// Catch any errors eagerly and wrap them in a ServiceExtensionResponse.
|
||||
var errorDetails = (st == null) ? '$e' : '$e\n$st';
|
||||
return new ServiceExtensionResponse.error(
|
||||
ServiceExtensionResponse.kExtensionError, errorDetails);
|
||||
ServiceExtensionResponse.extensionError, errorDetails);
|
||||
}).then((response) {
|
||||
// Post the valid response or the wrapped error after verifying that
|
||||
// the response is a ServiceExtensionResponse.
|
||||
if (response is! ServiceExtensionResponse) {
|
||||
response = new ServiceExtensionResponse.error(
|
||||
ServiceExtensionResponse.kExtensionError,
|
||||
ServiceExtensionResponse.extensionError,
|
||||
"Extension handler must complete to a ServiceExtensionResponse");
|
||||
}
|
||||
_postResponse(replyPort, id, response, trace_service);
|
||||
|
|
|
@ -45,22 +45,6 @@ class ServiceExtensionResponse {
|
|||
checkNotNullable(errorDetail, "errorDetail");
|
||||
}
|
||||
|
||||
/// Invalid method parameter(s) error code.
|
||||
@deprecated
|
||||
static const kInvalidParams = invalidParams;
|
||||
|
||||
/// Generic extension error code.
|
||||
@deprecated
|
||||
static const kExtensionError = extensionError;
|
||||
|
||||
/// Maximum extension provided error code.
|
||||
@deprecated
|
||||
static const kExtensionErrorMax = extensionErrorMax;
|
||||
|
||||
/// Minimum extension provided error code.
|
||||
@deprecated
|
||||
static const kExtensionErrorMin = extensionErrorMin;
|
||||
|
||||
/// Invalid method parameter(s) error code.
|
||||
static const invalidParams = -32602;
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
import 'dart:developer';
|
||||
|
||||
void main() {
|
||||
print(ServiceExtensionResponse.kInvalidParams);
|
||||
print(ServiceExtensionResponse.kExtensionError);
|
||||
print(ServiceExtensionResponse.kExtensionErrorMax);
|
||||
print(ServiceExtensionResponse.kExtensionErrorMin);
|
||||
print(ServiceExtensionResponse.invalidParams);
|
||||
print(ServiceExtensionResponse.extensionError);
|
||||
print(ServiceExtensionResponse.extensionErrorMax);
|
||||
print(ServiceExtensionResponse.extensionErrorMin);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue