Skip to content

Commit

Permalink
Use CaughtExceptionWithFiles instead of LibraryCycleLinkException.
Browse files Browse the repository at this point in the history
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: Iae70c6453930fca8ef8e2828cf7e3932cc742263
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153706
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
  • Loading branch information
scheglov authored and commit-bot@chromium.org committed Jul 9, 2020
1 parent 9dea0a8 commit aff2260
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
6 changes: 2 additions & 4 deletions pkg/analysis_server/lib/src/edit/edit_domain.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
import 'package:analysis_server/protocol/protocol_constants.dart';
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/collections.dart';
import 'package:analyzer/src/exception/exception.dart';
import 'package:analysis_server/src/computer/import_elements_computer.dart';
import 'package:analysis_server/src/domain_abstract.dart';
import 'package:analysis_server/src/edit/edit_dartfix.dart' show EditDartFix;
Expand Down Expand Up @@ -41,8 +42,6 @@ import 'package:analyzer/file_system/file_system.dart';
// ignore: deprecated_member_use
import 'package:analyzer/source/analysis_options_provider.dart';
import 'package:analyzer/source/line_info.dart';
import 'package:analyzer/src/dart/analysis/library_context.dart'
show LibraryCycleLinkException;
import 'package:analyzer/src/dart/analysis/results.dart' as engine;
import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:analyzer/src/dart/scanner/scanner.dart' as engine;
Expand Down Expand Up @@ -619,8 +618,7 @@ offset: $offset
error: $error
error.errorCode: ${error.errorCode}
''';
// TODO(scheglov) Use CaughtExceptionWithFiles when patch changed.
throw LibraryCycleLinkException(exception, stackTrace, {
throw CaughtExceptionWithFiles(exception, stackTrace, {
file: result.content,
'parameters': parametersFile,
});
Expand Down
13 changes: 2 additions & 11 deletions pkg/analyzer/lib/src/dart/analysis/library_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class LibraryContext {
'[cycle: $cycle]'
'[loadedBundles: ${loadedBundles.toList()}]'
'[elementFactory.libraries: $libraryUriList]';
throw LibraryCycleLinkException(
throw CaughtExceptionWithFiles(
'Cycle loading state error',
StackTrace.current,
{'status': statusText},
Expand Down Expand Up @@ -314,19 +314,10 @@ class LibraryContext {
fileContentMap[file.path] = file.content;
}
}
throw LibraryCycleLinkException(exception, stackTrace, fileContentMap);
throw CaughtExceptionWithFiles(exception, stackTrace, fileContentMap);
}
}

class LibraryContextTestView {
final List<Set<String>> linkedCycles = [];
}

/// TODO(scheglov) replace in the internal patch
class LibraryCycleLinkException extends CaughtExceptionWithFiles {
LibraryCycleLinkException(
Object exception,
StackTrace stackTrace,
Map<String, String> fileContentMap,
) : super(exception, stackTrace, fileContentMap);
}

0 comments on commit aff2260

Please sign in to comment.