Re: Try/Catch

new topic     » goto parent     » topic index » view thread      » older message » newer message

I prefer Go's handling of errors compared to exceptions as performed in other languages.

Routines which can fail on recoverable errors return an error code. Similar to Euphoria, Go can return multiple values from functions, cf "get" and "value" in Euphoria.

For unrecoverable errors, Go has "panic".

For cleaning up resources, Go has "defer" which defers the execution of a piece of code until the subroutine exits.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu