PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/runtime/error.d

http://github.com/wilkie/djehuty
D | 40 lines | 15 code | 6 blank | 19 comment | 0 complexity | 0c3d46a24390a6268abad40185f4d4ca MD5 | raw file
  1. /*
  2. * error.d
  3. *
  4. * This module implements the base class for a non recoverable failure.
  5. *
  6. */
  7. module runtime.error;
  8. import core.definitions;
  9. import core.exception;
  10. // Description: This is called when an assertion without a message fails.
  11. // file: The file that contains the error.
  12. // line: The line number of the error.
  13. void _d_assert(string file, uint line ) {
  14. throw new RuntimeError.Assert(file,line);
  15. }
  16. // Description: This is called when an assertion fails with a message.
  17. // msg: The message associated with the assert.
  18. // file: The file that contains the error.
  19. // line: The line number of the error.
  20. void _d_assert_msg(string msg, string file, uint line ) {
  21. throw new RuntimeError.Assert(msg, file, line);
  22. }
  23. // Description: This is called when an array bounds check fails.
  24. // file: The file that contains the error.
  25. // line: The line number of the error.
  26. void _d_array_bounds(string file, uint line ) {
  27. throw new DataException.OutOfBounds("Array");
  28. }
  29. // Description: This is called when there is no valid case for the switch.
  30. // file: The file that contains the error.
  31. // line: The line number of the error.
  32. void _d_switch_error(string file, uint line ) {
  33. throw RuntimeError.NoDefaultCase(file, line);
  34. }