iptoux / bash_error_lib

An standalone bash "library" that catches mostly all errors of an bash script.
Creative Commons Zero v1.0 Universal
3 stars 0 forks source link

Manual ErrorMsg #1

Closed iptoux closed 1 year ago

iptoux commented 1 year ago

Already in code, is an part where it controls an ARG (msg), that is piped to the function. Actually you can only pipe an simple "error message". But i working on the idea to pass an associative array as ARG so more information can be parsed.

iptoux commented 1 year ago

Done!

It's now possible to send own manual error messages. Just place the call _error "message" on some line and error will be called. Display of stack is not included, because we call "only" an simple function, there is no "really" error there.

iptoux@2040:~/gits/bash_error_lib$ ./basherr.sh 

------------------------------------------------
>> ERROR (1) - (M): General/External script error.

>> MSG: this is an random error
>> CALL/CMD/ARG: N/A (see message)
>> CAUSE BY: huhu IN: ./basherr.sh ON LINE: 50

>> SNIPPED:

>> -> 06 lines of source from ./basherr.sh <-
>> {
L:47      
L:48      huhu() {
L:49      
L:50   >>>_error "this is an random error"
L:51      
L:52      }
L:53      
>> }

>> There are 6 debug log files in folder, cleaning....
>>  Execution time: 0.17364144325256348 seconds