PageRenderTime 183ms CodeModel.GetById 81ms app.highlight 2ms RepoModel.GetById 98ms app.codeStats 0ms

/flash/echo-nest-flash-api/src/com/ryanberdeen/echonest/api/v3/EchoNestError.as

http://echo-nest-remix.googlecode.com/
ActionScript | 39 lines | 20 code | 5 blank | 14 comment | 0 complexity | 68b29194f1f10e32be0b3567069e2074 MD5 | raw file
 1/*
 2 * Copyright 2009 Ryan Berdeen. All rights reserved.
 3 * Distributed under the terms of the MIT License.
 4 * See accompanying file LICENSE.txt
 5 */
 6
 7package com.ryanberdeen.echonest.api.v3 {
 8  /**
 9  * Represents an Echo Nest API response with a nonzero status code.
10  */
11  public class EchoNestError extends Error {
12    private var _code:int;
13    private var _description:String;
14
15    public function EchoNestError(code:int, description:String):void {
16      super(code + ': ' + description);
17      _code = code;
18      _description = description;
19    }
20
21    /**
22    * The status message returned by the Echo Nest API.
23    */
24    public function get description():String {
25      return _description;
26    }
27
28    /**
29    * The status code returned by the Echo Nest API.
30    */
31    public function get code():int {
32      return _code;
33    }
34
35    public function createEvent():EchoNestErrorEvent {
36      return new EchoNestErrorEvent(EchoNestErrorEvent.ECHO_NEST_ERROR, _code, _description);
37    }
38  }
39}