GOLF(2gg)
π GOLF(2gg) π
okay bestie, you found the error-code page β it's the Golf documentation all about error-handling, and honestly? it's giving "the receipts" energy. every time something goes wrong in Golf, this is where you find out why. β¨
πΈ NAME πΈ
error-code β Golf documentation (error-handling). yep that's the whole vibe. π
π¦ DESCRIPTION π¦
so like. a lot of Golf statements hand you back a status with these GG_ERR_... error codes, and ngl they're descriptive to a point. they don't always get as granular as the operating system's errno variable, though β but don't panic, bestie, because you can pull the last known errno value from those statements with the errno clause in the get-req statement. π
girl, listen. grab that value as soon as possible after the statement runs, because another statement might come along and overwrite it afterwards. it is not going to wait for you. π
here's the example, and it's lowkey iconic. a directory gets attempted-deleted via delete-file, which fails with GG_ERR_DELETE β but you can snag a way more specific code through errno. in this case it's 21, aka EISDIR, which literally means it cannot delete a directory with this statement:
delete-file "some_directory" status stc
if-true stc equal GG_ERR_DELETE
get-req errno to e
@Cannot delete file
print-format "Error %ld\n", e
end-if
β οΈ important note β οΈ with some GG_ERR_... codes, the errno clause in get-req may return 0. and what does that mean? it means the error was detected by Golf itself and not reported by the operating system. so 0 here isn't "no error", it's "this one's on Golf, not the OS". π«Ά
you can also use the standard Linux constants β the ones defined in the C errno.h include file β to compare the error code you got with get-req. for instance, constants like EACCES or EEXIST. π
and if you ever wanna know what a specific errno number or name actually means? just use the standard Linux utility errno. it'll tell you. main character utility behaviour, fr fr. π
β¨ SEE ALSO β¨
- Error handling
db-errorerror-codeerror-handlingreport-error- See all documentation
and that's the whole page, bestie!! π this one's from $VERSION and it's dated $DATE β so go forth, catch those error codes, and slay. periodt. ππ
π¦ 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