13 lines
312 B
Go
13 lines
312 B
Go
package main
|
|
|
|
// Convert the checked Ziran result at the existing Go HTTP error boundary.
|
|
func authenticationError(result AuthenticationResult) error {
|
|
if result.Error != nil {
|
|
return result.Error
|
|
}
|
|
if result.Status != 0 {
|
|
return authError{status: result.Status, message: result.Message}
|
|
}
|
|
return nil
|
|
}
|