Skip to content

Commit aff2260

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
Use CaughtExceptionWithFiles instead of LibraryCycleLinkException.
[email protected], [email protected] Change-Id: Iae70c6453930fca8ef8e2828cf7e3932cc742263 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153706 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 9dea0a8 commit aff2260

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

pkg/analysis_server/lib/src/edit/edit_domain.dart

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
99
import 'package:analysis_server/protocol/protocol_constants.dart';
1010
import 'package:analysis_server/src/analysis_server.dart';
1111
import 'package:analysis_server/src/collections.dart';
12+
import 'package:analyzer/src/exception/exception.dart';
1213
import 'package:analysis_server/src/computer/import_elements_computer.dart';
1314
import 'package:analysis_server/src/domain_abstract.dart';
1415
import 'package:analysis_server/src/edit/edit_dartfix.dart' show EditDartFix;
@@ -41,8 +42,6 @@ import 'package:analyzer/file_system/file_system.dart';
4142
// ignore: deprecated_member_use
4243
import 'package:analyzer/source/analysis_options_provider.dart';
4344
import 'package:analyzer/source/line_info.dart';
44-
import 'package:analyzer/src/dart/analysis/library_context.dart'
45-
show LibraryCycleLinkException;
4645
import 'package:analyzer/src/dart/analysis/results.dart' as engine;
4746
import 'package:analyzer/src/dart/ast/utilities.dart';
4847
import 'package:analyzer/src/dart/scanner/scanner.dart' as engine;
@@ -619,8 +618,7 @@ offset: $offset
619618
error: $error
620619
error.errorCode: ${error.errorCode}
621620
''';
622-
// TODO(scheglov) Use CaughtExceptionWithFiles when patch changed.
623-
throw LibraryCycleLinkException(exception, stackTrace, {
621+
throw CaughtExceptionWithFiles(exception, stackTrace, {
624622
file: result.content,
625623
'parameters': parametersFile,
626624
});

pkg/analyzer/lib/src/dart/analysis/library_context.dart

+2-11
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class LibraryContext {
172172
'[cycle: $cycle]'
173173
'[loadedBundles: ${loadedBundles.toList()}]'
174174
'[elementFactory.libraries: $libraryUriList]';
175-
throw LibraryCycleLinkException(
175+
throw CaughtExceptionWithFiles(
176176
'Cycle loading state error',
177177
StackTrace.current,
178178
{'status': statusText},
@@ -314,19 +314,10 @@ class LibraryContext {
314314
fileContentMap[file.path] = file.content;
315315
}
316316
}
317-
throw LibraryCycleLinkException(exception, stackTrace, fileContentMap);
317+
throw CaughtExceptionWithFiles(exception, stackTrace, fileContentMap);
318318
}
319319
}
320320

321321
class LibraryContextTestView {
322322
final List<Set<String>> linkedCycles = [];
323323
}
324-
325-
/// TODO(scheglov) replace in the internal patch
326-
class LibraryCycleLinkException extends CaughtExceptionWithFiles {
327-
LibraryCycleLinkException(
328-
Object exception,
329-
StackTrace stackTrace,
330-
Map<String, String> fileContentMap,
331-
) : super(exception, stackTrace, fileContentMap);
332-
}

0 commit comments

Comments
 (0)