home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d8xx / d811 / bsh.lha / bsh / error < prev    next >
Text File  |  1993-02-14  |  2KB  |  68 lines

  1. # error - tells you what the bsh error numbers mean; you can also use it
  2. # with AmigaDOS error numbers - it just calls Fault with the number you pass.
  3. #
  4. # Error is presented as is; no warrantee is either expressed or implied
  5. # as to it's suitability to any purpose whatsoever.  You assume all the
  6. # risk for all damage, even if caused by a defect in the software,
  7. # no matter how awful.
  8. if !?argv[1]
  9.     echo >&2 usage: error num
  10.     return 10
  11. elseif !numeric(argv[1])
  12.     echo >&2 usage: error num
  13.     return 10
  14. endif
  15. if argv[1] < 900
  16.     Fault $1
  17.     return
  18. endif
  19. local IFS="\n" errs m=argv[1]-900
  20.  
  21. set errs `cat << +`
  22. insufficient arguments
  23. no such label
  24. must be in script file
  25. syntax error
  26. redirection error
  27. name too long
  28. attempt to mv a directory inside itself
  29. destination not a directory
  30. attempt to mv a volume or device
  31. undefined variable
  32. if nesting limit exceeded
  33. ambiguous
  34. no match
  35. bad while/if nesting
  36. no corresponding while
  37. missing endif
  38. missing endwhile
  39. no corresponding if
  40. attempt to overwrite file
  41. unable to append to file
  42. divide by zero
  43. subscript out of range
  44. subscript required with array
  45. unknown command
  46. cannot nest foreach command
  47. command not allowed within foreach
  48. there is no error 926
  49. EOF
  50. can't open file or library
  51. execute permission denied
  52. operator/operand stack overflow
  53. wildcard pattern too complex
  54. script recursion limit exceeded
  55. missing parenthesis
  56. While nesting limit exceeded
  57. Alias recursion limit exceeded
  58. Stack overflow
  59. operand not numeric
  60. insufficient arguments
  61. +
  62.  
  63. if m >= #errs
  64.     echo unknown error: $1
  65. else
  66.     echo error $1: $errs[$m]
  67. endif
  68.