GOLF(2gg)
π GOLF(2gg) β bestie edition π
okay so this is the Golf manual, section 2gg, from the Development crew β¨
β¨ NAME β¨
error-handling β Golf documentation (error-handling)
π«Ά DESCRIPTION π«Ά
π WHEN YOUR PROGRAM ERRORS OUT π
so "erroring out" literally means a process that's handling a request has hit a difficulty it cannot handle, and it's gonna do one of two things:
- Skip the rest of the request, and move on quickly to handle the next request without exiting. Most errors are like this, bestie β for example your program has attempted to access memory outside of what's allocated, or you have called
report-errorstatement. - Stop and exit, and it may be automatically restarted if it's a service. For instance, the process could be out of memory, or the database is permanently down and connection cannot be re-established.
ngl, note that if your program is command-line, it will exit in any case since it handles a single request anyway. no survivors π
π§ WHEN THERE IS A PROBLEM IN GOLF π§
If there is a fatal internal error (i.e. error in Golf code itself that cannot be handled), it will be caught by Golf, and the process will end. And if your process is started with mgrg, it may be automatically restarted. the way that it just picks itself back up ππ
π LOGGING THE ERROR π
Regardless of the type of error and regardless of whether the process exits or not, the error is logged, and the program stack with full source code lines (see gg for including debug information) will be written to backtrace file (use -e option of gg to obtain its location).
lowkey important: the program stack is logged only if debugging info is present (i.e. if installed from package you must install debugging package as well). no debug info, no stack, periodt.
You can see the list of last N errors (and the location of file containing backtrace for them) by using gg. for instance, to see the last 3 errors:
gg -e 3
slay. that's it, that's the whole vibe check πΈ
π SEE ALSO π
- Error handling
db-errorerror-codeerror-handlingreport-errorSee all documentation
π that's a wrap, bestie! this page was served fresh on $DATE, version $VERSION, and it's GOLF(2gg) β go forth and handle your errors, main character π
π
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms