adaojunior / pusher

The Dart library for interacting with the Pusher HTTP API.
https://pub.dartlang.org/packages/pusher
MIT License
12 stars 13 forks source link

get, trigger, should throw exceptions when something goes wrong #7

Open adaojunior opened 8 years ago

adaojunior commented 8 years ago
part of pusher;

class PusherException implements Exception {

  /// Error message
  final String message;

  PusherException(this.message);

  /// Error message
  String toString() => message;
}

class RequestException extends PusherException {

  /// Request URL
  final Uri url;

  /// Request status code
  final int statusCode;

  /// Response body, if received
  final String body;

  RequestException(String message,this.url, this.statusCode,[this.body]) : super(message);

}