PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Lib/tcl/tclerrors.swg

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