GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

πŸ’– GOLF(2gg) β€” the manual, but make it cute πŸ’–

okay bestie, sit down, we're doing the 2gg golf manual together and honestly? this one's a lil bop. it's GOLF(2gg), from the Development</> section, and today's main character is exit-handler. πŸŒοΈβ™€οΈβœ¨


🌸 NAME 🌸

exit-handler β€” no cap, it's all about (program-flow) πŸ¦‹


πŸŽ€ PURPOSE πŸŽ€

Exit current request processing. that's it, that's the whole vibe. girl said "I'm out" and meant it πŸ’…


✨ SYNTAX ✨

exit-handler [ <request status> ]

πŸ‘‘ DESCRIPTION πŸ‘‘

So here's the tea 🍡 β€” exit-handler exits the current request by transferring control directly after the top-level request dispatcher. Like, not just "I'm leaving the room", it's "I'm leaving the building, straight past the dispatcher, don't talk to me". πŸšͺπŸ’¨

But WAIT. if there's an after-handler, bestie, it still runs. it will still execute. periodt. 🫢

⚠️ the ONE exception: if exit-handler is called from before-handler, then nope, the after-handler does not run. read that again. it matters. 😭

Now about <request status> β€” that number is the request status returned to the caller (peep exit-status for the full lore πŸ‘€). And the defaults are lowkey a whole chain:

  • if you don't specify it, then it's the value specified in the last executed exit-status statement;
  • if none was executed, then it's 0. iconic. ⭐

πŸ’– EXAMPLES πŸ’–

Returning status of 20

begin-handler /req-handler public
    ...
    exit-status 20
    ...
    exit-handler
    ...
end-handler

Returning status of 0

begin-handler /req-handler public
    ...
    exit-handler
    ...
end-handler

Returning status of 10

begin-handler /req-handler public
    ...
    exit-handler 10
    ...
end-handler

see how the middle one just... doesn't say a number? that's the default doing its lil thing. slay. ✨


πŸ¦‹ SEE ALSO πŸ¦‹

Program flow

break-loop call-handler code-blocks continue-loop do-once exit-handler if-defined if-true quit-process return-handler start-loop See all documentation

yes bestie, exit-handler is listed in its own SEE ALSO. she's self-referential AND self-confident. main character energy fr fr πŸ’€πŸ’…

okay that's the whole page, you ate that πŸ“πŸ’œ β€” this was version $VERSION, dated $DATE, and yes those came straight from the footer, we don't skip footers in this house. bye bestie!! 🌈⭐

πŸ“¦ where this page comes from