[DAP] Add field showToUser to DebugAdapterException

Bug: https://github.com/dart-lang/sdk/issues/55789
Change-Id: I204672f8e4cf2d073e7640665eaaaa9c8028efe7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369720
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
This commit is contained in:
Elliott Brooks 2024-06-04 21:03:23 +00:00 committed by Commit Queue
parent 2fe6c5d532
commit 150c24f332
3 changed files with 13 additions and 2 deletions

View file

@ -1,3 +1,7 @@
## 1.3.0
- Add `showToUser` field to `DebugAdapterException` to specify which errors should be shown to users.
## 1.2.0
- Added `DartInitializeRequestArguments`, a subclass of `InitializeRequestArguments` that supports a custom flag `supportsDartUris` for informing the debug adapter that the client supports using URIs in places that might usually be file paths (such as `stackTraceRequest`). Setting this flag indicates that the client supports `file:` URIs _and also_ any custom-scheme URIs whose content can be provided by the analysis server from the matching Dart SDK.

View file

@ -8,7 +8,10 @@
class DebugAdapterException implements Exception {
final String message;
DebugAdapterException(this.message);
/// Whether or not to show the error to the user as a notification.
final bool showToUser;
DebugAdapterException(this.message, {this.showToUser = false});
@override
String toString() => 'DebugAdapterException: $message';
@ -37,12 +40,16 @@ class DebugAdapterInvalidArgumentException implements DebugAdapterException {
final Type actualType;
final Object? actualValue;
@override
final bool showToUser;
DebugAdapterInvalidArgumentException({
required this.requestName,
required this.argumentName,
required this.expectedType,
required this.actualType,
required this.actualValue,
this.showToUser = false,
});
@override

View file

@ -1,5 +1,5 @@
name: dap
version: 1.2.0
version: 1.3.0
description: >-
A package of classes that are generated from the DAP specifications along with
their generating code.