Tutorial by Topics: error

In Go, unexpected situations are handled using errors, not exceptions. This approach is more similar to that of C, using errno, than to that of Java or other object-oriented languages, with their try/catch blocks. However, an error is not an integer but an interface.

A function that may fail typically returns an error as its last return value. If this error is not nil, something went wrong, and the caller of the function should take action accordingly.

Rust uses Result<T, E> values to indicate recoverable errors during execution. Unrecoverable errors cause Panics which is a topic of its own.
An error 1009 is a general error that arises when you are trying to receive a value out of a variable or property that has a value of null. The examples provided expose various cases where this error arises, together with some recommendations on how to mitigate the error.

Page 1 of 3