diff options
author | ianhin <ianhin> | 2006-01-13 16:17:19 +0000 |
---|---|---|
committer | ianhin <ianhin> | 2006-01-13 16:17:19 +0000 |
commit | 18200f4529b2d4555cf55cedfc478ebd278764dd (patch) | |
tree | ad425cf7e60d8a71255b24e66efdb44fce026d9b /Tools/MathematicaMisc/Errors.m | |
parent | a17acb54cd79514cc4e70a06f229d7ab8c850148 (diff) |
Added KrancError function for throwing errors to be caught at top
level. Removed printing of stack backtrace as it doesn't work. I
have an email from Wolfram support with some advice on how to do stack
backtraces; I will investigate soon.
Diffstat (limited to 'Tools/MathematicaMisc/Errors.m')
-rw-r--r-- | Tools/MathematicaMisc/Errors.m | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Tools/MathematicaMisc/Errors.m b/Tools/MathematicaMisc/Errors.m index 02e50f5..b7c38b2 100644 --- a/Tools/MathematicaMisc/Errors.m +++ b/Tools/MathematicaMisc/Errors.m @@ -3,6 +3,7 @@ BeginPackage["Errors`"]; PrintError::usage = ""; ThrowError::usage = ""; +KrancError::usage = ""; Begin["`Private`"]; @@ -36,8 +37,9 @@ PrintError[err_] := stack = err[[2]]; Map[PrintStructure, objs]; - Print["Error stack:"]; - PrintStructure[stack]], +(* Print["Error stack:"]; + PrintStructure[stack]*) +], err]]; @@ -45,7 +47,7 @@ ThrowError[objects__] := Module[{s = Stack[_], s2}, s2 = removeBits[s]; - Throw[KrancError[{objects}, s2]]]; + Throw[KrancError[{objects}, s2], KrancError]]; End[]; |