Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableDebugMode ¶
func EnableDebugMode()
func RecordedError ¶
Prints an error message to the error log and returns a new error with the given message. This method can receive also more arguments (e.g an external error) and they will be appended to the given error message.
For example, we have a local method `someMethod()`. This method handles its own error printing and thus we can consume the error and not append it to the new error message, as follows:
returnVal, err := someMethod() if err != nil { return nil, log.RecordedError("failed to run someMethod") }
On the other hand, if `someMethod()` is a 3rd party method we want to print also the returned error as it wasn't printed to the error log. So we'll have the following code:
returnVal, err := 3rdParty.someMethod() if err != nil { return nil, log.RecordedError(fmt.Sprintf("failed to run someMethod. Reason: %s", err)) }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.