angular/modules/angular2/src/facade/exceptions.dart
Jacob Richman 3e65d1458e fix(Dart): make some playground samples run with Dart Dev Compiler
Resolve all invalid field override errors, workaround current
reflection limitations in Dart Dev Compiler. todo, hello_world and
key_events samples now work with Dart Dev Compiler.

BREAKING CHANGE: remove TemplateRef.elementRef setter

Closes #6441
2016-01-21 00:41:42 +00:00

50 lines
941 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 get message => _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;
}
dynamic get context => _context;
String get wrapperMessage => _wrapperMessage;
}
Error makeTypeError([String message = ""]) {
return new BaseException(message);
}
dynamic unimplemented() {
throw new BaseException('unimplemented');
}