err := doSomething() if err != nil { probe.Error(err) // Do something else }
func doSomething() error { // Do something if err != nil { return probe.NewError(err) } // Do something else return nil }In this example, the `probe.NewError` function is used to create a new error with a stack trace included. Overall, the Minio XL package provides a convenient way of handling errors and formatting error messages in a standardized manner.