Skip to content

Conversation

iptoux
Copy link
Owner

@iptoux iptoux commented Dec 23, 2022

Done!

All things are back in library/script. Now the whole library is more modular, so future editing and adding of features should be easier. The library had now the following functions:

  • (rewrote) bs_error_trap
  • (old) bs_debug
  • (rewrote/new) error_read_file
  • (rewrote) error_merge_vars
  • (new) error_stacktrace
  • (rewrote/new) error_out_msg
  • (rewrote/new) error_out_log
  • (new) error_read_src
  • (new) error_exit_clean

Commits branch: main...7-bug-external-errors

CLI (all on)

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

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

>> MSG: No such file or directory
>> CALL/CMD/ARG: lol

>> CAUSE BY: cat IN: ./basherr.sh ON LINE: 50
>> FULLSTACK:
    huhu @ ./basherr.sh:50
    main @ ./basherr.sh:54

>> SNIPPED:

>> -> 08 lines of source from  <-
>> {
L:46      #somecommand        # <-
L:47      
L:48      huhu() {
L:49      
L:50   >>>    cat lol
L:51      
L:52      }
L:53      
L:54      huhu
>> }

>> There are 6 log files in folder, cleaning....
>> Execution time: 0.322949 seconds
iptoux@2040:~/gits/bash_error_lib$ 

LOGFILE (simple)

>> Date/Time: 23.12.2022 - 23:37:46
------------------------------------------------
>> ERROR (1) - General/External script error.

>> MSG: No such file or directory
>> CALL/CMD/ARG: lol

>> CAUSE BY: cat IN: ./basherr.sh ON LINE: 50
>> FULLSTACK:
    huhu @ ./basherr.sh:50
    main @ ./basherr.sh:54

>> SNIPPED:

>> -> 08 lines of source from  <-
>> {
L:46      #somecommand        # <-
L:47      
L:48      huhu() {
L:49      
L:50   >>>    cat lol
L:51      
L:52      }
L:53      
L:54      huhu
>> }

Rework how script checks if error, new way arguments processed.
Setup name of new traps.
Setup new name of traps and given args
Full recode of loading file and args, check if call is by external command included in this step.
Adding an "merger" to the library to compare & merge variables given by trap and file.
Adding new output function (wip) and fix some typo.
First inclusion of stacktrace!
Fixing some typo and add missing function call.
Add script execution time and new case of error in file.
Add global vars to prepare script for automatic cleanup of logs after (n) day's or (n) count
Add display of file source, rename vars, clean code to get more variable
causing an error to get the output.
Added the option to log into file as default output or fancy. Rename functions & fixing.
fixing some catch bugs, working on cleanup, fix vars.
adding some external call error test to check vars.
Update content to new behaviour and add some new informations.

main...7-bug-external-errors
@iptoux iptoux added the done label Dec 23, 2022
@iptoux iptoux added this to the v1.2.0 milestone Dec 23, 2022
@iptoux iptoux self-assigned this Dec 23, 2022
@iptoux iptoux linked an issue Dec 23, 2022 that may be closed by this pull request
@iptoux iptoux merged commit 49abfeb into main Dec 23, 2022
@iptoux iptoux deleted the 7-bug-external-errors branch December 23, 2022 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

BUG & External Errors
1 participant