PageRenderTime 53ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/src/ruse/error.d

http://github.com/boredomist/ruse
D | 64 lines | 35 code | 10 blank | 19 comment | 0 complexity | 5ce6da5d07cbb31ed7429dbba7e89363 MD5 | raw file
Possible License(s): GPL-3.0
  1. // error.d
  2. //
  3. // Copyright 2010 Erik Price <erik <dot> price16 <at> gmail <dot> com>
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation; either version 2 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  18. // MA 02110-1301, USA.
  19. module ruse.error;
  20. // collection of ruse error classes
  21. class RuseError {
  22. public string message;
  23. this(string s) {
  24. message = s;
  25. }
  26. this() {
  27. message = "an error occured!";
  28. }
  29. }
  30. class SyntaxError : RuseError {
  31. this(string s) {
  32. message = s;
  33. }
  34. }
  35. class EOFError : RuseError {
  36. this(string s) {
  37. message = s;
  38. }
  39. }
  40. class UndefinedSymbolError : RuseError {
  41. this(string s) {
  42. message = s;
  43. }
  44. }
  45. class ArgumentError : RuseError {
  46. this(string s) {
  47. message = s;
  48. }
  49. }
  50. class IncompatibleTypesError : RuseError {
  51. this(string s) {
  52. message = s;
  53. }
  54. }