| 1 | package errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/ |
| 2 | |
| 3 | import ( |
| 4 | "errorsscip-go gomod github.com/golang/go/src go1.25.0 errors/" |
| 5 | "testingscip-go gomod github.com/golang/go/src go1.25.0 testing/" |
| 6 | ) |
| 7 | |
| 8 | func TestChecksHandleGoErrorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/TestChecksHandleGoErrors().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 9 | err := errorsscip-go gomod github.com/golang/go/src go1.25.0 errors/.Newscip-go gomod github.com/golang/go/src go1.25.0 errors/New().("go error") |
| 10 | |
| 11 | if IsFatalErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/IsFatalError().(err) { |
| 12 | t.Errorscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Error().("go error should not be a fatal error") |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | func TestCheckHandlesWrappedErrorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/TestCheckHandlesWrappedErrors().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 17 | err := errorsscip-go gomod github.com/golang/go/src go1.25.0 errors/.Newscip-go gomod github.com/golang/go/src go1.25.0 errors/New().("go error") |
| 18 | |
| 19 | fatal := NewFatalErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/NewFatalError().(err) |
| 20 | |
| 21 | if !IsFatalErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/IsFatalError().(fatal) { |
| 22 | t.Errorscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Error().("expected error to be fatal") |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | func TestBehaviorWrapsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/TestBehaviorWraps().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 27 | err := errorsscip-go gomod github.com/golang/go/src go1.25.0 errors/.Newscip-go gomod github.com/golang/go/src go1.25.0 errors/New().("go error") |
| 28 | |
| 29 | fatal := NewFatalErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/NewFatalError().(err) |
| 30 | ni := NewNotImplementedErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/NewNotImplementedError().(fatal) |
| 31 | |
| 32 | if !IsNotImplementedErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/IsNotImplementedError().(ni) { |
| 33 | t.Errorscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Error().("expected error to be not implemented") |
| 34 | } |
| 35 | |
| 36 | if !IsFatalErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/IsFatalError().(ni) { |
| 37 | t.Errorscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Error().("expected wrapped error to also be fatal") |
| 38 | } |
| 39 | |
| 40 | if IsNotImplementedErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/IsNotImplementedError().(fatal) { |
| 41 | t.Errorscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Error().("expected fatal error to not be not implemented") |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | func TestContextOnGoErrorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/TestContextOnGoErrors().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 46 | err := errorsscip-go gomod github.com/golang/go/src go1.25.0 errors/.Newscip-go gomod github.com/golang/go/src go1.25.0 errors/New().("go error") |
| 47 | |
| 48 | SetContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/SetContext().(err, "foo", "bar") |
| 49 | |
| 50 | v := GetContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/GetContext().(err, "foo") |
| 51 | if v == "bar" { |
| 52 | t.Errorscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Error().("expected empty context on go error") |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | func TestContextOnWrappedErrorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/TestContextOnWrappedErrors().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 57 | err := NewFatalErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/NewFatalError().(errorsscip-go gomod github.com/golang/go/src go1.25.0 errors/.Newscip-go gomod github.com/golang/go/src go1.25.0 errors/New().("go error")) |
| 58 | |
| 59 | SetContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/SetContext().(err, "foo", "bar") |
| 60 | |
| 61 | if v := GetContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/GetContext().(err, "foo"); v != "bar" { |
| 62 | t.Errorscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Error().("expected to be able to use context on wrapped errors") |
| 63 | } |
| 64 | |
| 65 | ctxt := Contextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/Context().(err) |
| 66 | if ctxt["foo"] != "bar" { |
| 67 | t.Errorscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Error().("expected to get the context of an error") |
| 68 | } |
| 69 | |
| 70 | DelContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/DelContext().(err, "foo") |
| 71 | |
| 72 | if v := GetContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/GetContext().(err, "foo"); v == "bar" { |
| 73 | t.Errorfscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Errorf().("expected to delete from error context") |
| 74 | } |
| 75 | } |