angular/modules/angular2/src/facade/exceptions.dart
vsavkin 79472b77ca refactor(core): move facades out of core
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}'.
2015-11-07 01:36:06 +00:00

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');
}