PageRenderTime 41ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 1ms

/trunk/Lib/tcl/tclerrors.swg

#
Unknown | 76 lines | 69 code | 7 blank | 0 comment | 0 complexity | 7bd9096e32f9793f74798ef114706d3a MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* -----------------------------------------------------------------------------
  2. * error manipulation
  3. * ----------------------------------------------------------------------------- */
  4. SWIGINTERN const char*
  5. SWIG_Tcl_ErrorType(int code) {
  6. const char* type = 0;
  7. switch(code) {
  8. case SWIG_MemoryError:
  9. type = "MemoryError";
  10. break;
  11. case SWIG_IOError:
  12. type = "IOError";
  13. break;
  14. case SWIG_RuntimeError:
  15. type = "RuntimeError";
  16. break;
  17. case SWIG_IndexError:
  18. type = "IndexError";
  19. break;
  20. case SWIG_TypeError:
  21. type = "TypeError";
  22. break;
  23. case SWIG_DivisionByZero:
  24. type = "ZeroDivisionError";
  25. break;
  26. case SWIG_OverflowError:
  27. type = "OverflowError";
  28. break;
  29. case SWIG_SyntaxError:
  30. type = "SyntaxError";
  31. break;
  32. case SWIG_ValueError:
  33. type = "ValueError";
  34. break;
  35. case SWIG_SystemError:
  36. type = "SystemError";
  37. break;
  38. case SWIG_AttributeError:
  39. type = "AttributeError";
  40. break;
  41. default:
  42. type = "RuntimeError";
  43. }
  44. return type;
  45. }
  46. SWIGINTERN void
  47. SWIG_Tcl_SetErrorObj(Tcl_Interp *interp, const char *ctype, Tcl_Obj *obj)
  48. {
  49. Tcl_ResetResult(interp);
  50. Tcl_SetObjResult(interp, obj);
  51. Tcl_SetErrorCode(interp, "SWIG", ctype, NULL);
  52. }
  53. SWIGINTERN void
  54. SWIG_Tcl_SetErrorMsg(Tcl_Interp *interp, const char *ctype, const char *mesg)
  55. {
  56. Tcl_ResetResult(interp);
  57. Tcl_SetErrorCode(interp, "SWIG", ctype, NULL);
  58. Tcl_AppendResult(interp, ctype, " ", mesg, NULL);
  59. /*
  60. Tcl_AddErrorInfo(interp, ctype);
  61. Tcl_AddErrorInfo(interp, " ");
  62. Tcl_AddErrorInfo(interp, mesg);
  63. */
  64. }
  65. SWIGINTERNINLINE void
  66. SWIG_Tcl_AddErrorMsg(Tcl_Interp *interp, const char* mesg)
  67. {
  68. Tcl_AddErrorInfo(interp, mesg);
  69. }