File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ Core functions for any Bash program
15
15
* [ core.err_exists()] ( #coreerr_exists )
16
16
* [ core.panic()] ( #corepanic )
17
17
* [ core.print_stacktrace()] ( #coreprint_stacktrace )
18
+ * [ core.print_die_fn()] ( #coreprint_die_fn )
18
19
* [ core.print_fatal_fn()] ( #coreprint_fatal_fn )
19
20
* [ core.print_error_fn()] ( #coreprint_error_fn )
20
21
* [ core.print_warn_fn()] ( #coreprint_warn_fn )
@@ -159,6 +160,15 @@ core.trap_add 'err_handler' ERR
159
160
160
161
_ Function has no arguments._
161
162
163
+ ### core.print_die_fn()
164
+
165
+ Print a error message to standard error including the function name
166
+ of the callee to standard error and die
167
+
168
+ #### Arguments
169
+
170
+ * ** $1** (string): message
171
+
162
172
### core.print_fatal_fn()
163
173
164
174
Print a fatal error message including the function name of the callee
Original file line number Diff line number Diff line change @@ -283,6 +283,15 @@ core.print_stacktrace() {
283
283
fi
284
284
} >&2
285
285
286
+ # @description Print a error message to standard error including the function name
287
+ # of the callee to standard error and die
288
+ # @arg $1 string message
289
+ core.print_die_fn () {
290
+ local msg=" $1 "
291
+
292
+ core.print_die " ${FUNCNAME[1]} ()${msg: +" : " } $msg "
293
+ }
294
+
286
295
# @description Print a fatal error message including the function name of the callee
287
296
# to standard error
288
297
# @arg $1 string message
You can’t perform that action at this time.
0 commit comments