OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library appengine.api.errors; |
| 6 |
| 7 import 'dart:io'; |
| 8 |
| 9 class AppEngineError implements Exception { |
| 10 final String message; |
| 11 |
| 12 AppEngineError(this.message); |
| 13 |
| 14 String toString() => "AppEngineException: $message"; |
| 15 } |
| 16 |
| 17 class NetworkError extends AppEngineError implements IOException { |
| 18 NetworkError(String message) : super(message); |
| 19 |
| 20 String toString() => "NetworkError: $message"; |
| 21 } |
| 22 |
| 23 class ProtocolError extends AppEngineError implements IOException { |
| 24 static ProtocolError INVALID_RESPONSE = new ProtocolError("Invalid response"); |
| 25 |
| 26 ProtocolError(String message) : super(message); |
| 27 |
| 28 String toString() => "ProtocolError: $message"; |
| 29 } |
| 30 |
| 31 class ServiceError extends AppEngineError { |
| 32 final String serviceName; |
| 33 |
| 34 ServiceError(String message, {this.serviceName: 'ServiceError'}) |
| 35 : super(message); |
| 36 |
| 37 String toString() => "$serviceName: $message"; |
| 38 } |
| 39 |
| 40 class ApplicationError extends AppEngineError { |
| 41 ApplicationError(String message) : super(message); |
| 42 |
| 43 String toString() => "ApplicationError: $message"; |
| 44 } |
OLD | NEW |