Timeline for Trap, ERR, and echoing the error line
Current License: CC BY-SA 4.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 18, 2021 at 17:04 | comment | added | unpythonic | @TarekEldeeb - This isn't like catching an error in other languages, by the time that the error trap is called, the script is in the process of stopping. There's no option here to return to the command which caused the errexit to be invoked. | |
| Jun 17, 2021 at 13:13 | comment | added | Tarek Eldeeb | I'm confused about "set -e", I think this means exit on error. But you're handling the error. I cannot understand the purpose. | |
| Mar 7, 2019 at 18:42 | comment | added | tricasse |
This would be even better using $(caller)'s data to give the context even if the failure is not in the current script but one of its imports. Very nice though!
|
|
| Mar 7, 2019 at 1:02 | history | answered | unpythonic | CC BY-SA 4.0 |