
This is part of ongoing work to make core platform-independent. BREAKING CHANGE All private exports from 'angular2/src/core/facade/{lang,collection,exception_handler}' should be replaced with 'angular2/src/facade/{lang,collection,exception_handler}'.
44 lines
815 B
Dart
44 lines
815 B
Dart
library angular.core.facade.exceptions;
|
|
|
|
import 'exception_handler.dart';
|
|
export 'exception_handler.dart';
|
|
|
|
class BaseException extends Error {
|
|
final String message;
|
|
|
|
BaseException([this.message]);
|
|
|
|
String toString() {
|
|
return this.message;
|
|
}
|
|
}
|
|
|
|
class WrappedException extends Error {
|
|
final dynamic context;
|
|
final String wrapperMessage;
|
|
final originalException;
|
|
final originalStack;
|
|
|
|
WrappedException(
|
|
[this.wrapperMessage,
|
|
this.originalException,
|
|
this.originalStack,
|
|
this.context]);
|
|
|
|
get message {
|
|
return ExceptionHandler.exceptionToString(this);
|
|
}
|
|
|
|
String toString() {
|
|
return this.message;
|
|
}
|
|
}
|
|
|
|
Error makeTypeError([String message = ""]) {
|
|
return new BaseException(message);
|
|
}
|
|
|
|
dynamic unimplemented() {
|
|
throw new BaseException('unimplemented');
|
|
}
|