/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. package com.ryanberdeen.echonest.api.v3 {
  7. /**
  8. * Represents an Echo Nest API response with a nonzero status code.
  9. */
  10. public class EchoNestError extends Error {
  11. private var _code:int;
  12. private var _description:String;
  13. public function EchoNestError(code:int, description:String):void {
  14. super(code + ': ' + description);
  15. _code = code;
  16. _description = description;
  17. }
  18. /**
  19. * The status message returned by the Echo Nest API.
  20. */
  21. public function get description():String {
  22. return _description;
  23. }
  24. /**
  25. * The status code returned by the Echo Nest API.
  26. */
  27. public function get code():int {
  28. return _code;
  29. }
  30. public function createEvent():EchoNestErrorEvent {
  31. return new EchoNestErrorEvent(EchoNestErrorEvent.ECHO_NEST_ERROR, _code, _description);
  32. }
  33. }
  34. }