transaction: Return errors wrapping pam.Error values on failure
If the transaction fails during start, there's no way to get the error detail in a programmatic way, so let's wrap the pam.Error to allow more per-type checks.
This commit is contained in:
@@ -208,6 +208,13 @@ func TestPAM_ConfDir_FailNoServiceOrUnsupported(t *testing.T) {
|
||||
if len(s) == 0 {
|
||||
t.Fatalf("error #expected an error message")
|
||||
}
|
||||
var pamErr Error
|
||||
if !errors.As(err, &pamErr) {
|
||||
t.Fatalf("error #unexpected type: %#v", err)
|
||||
}
|
||||
if pamErr != ErrAbort {
|
||||
t.Fatalf("error #unexpected status: %v", pamErr)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPAM_ConfDir_InfoMessage(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user