(reason taskpkg.AutonomyReasonCode)
| 5018 | } |
| 5019 | |
| 5020 | func autonomyToolErrorCodeAndReason(reason taskpkg.AutonomyReasonCode) ( |
| 5021 | toolspkg.ErrorCode, |
| 5022 | toolspkg.ReasonCode, |
| 5023 | error, |
| 5024 | ) { |
| 5025 | switch reason { |
| 5026 | case taskpkg.AutonomySessionRequired: |
| 5027 | return toolspkg.ErrorCodeDenied, toolspkg.ReasonAutonomySessionRequired, toolspkg.ErrToolDenied |
| 5028 | case taskpkg.AutonomyForeignRun: |
| 5029 | return toolspkg.ErrorCodeDenied, toolspkg.ReasonAutonomyForeignRun, toolspkg.ErrToolDenied |
| 5030 | case taskpkg.AutonomyNoActiveLease: |
| 5031 | return toolspkg.ErrorCodeConflict, toolspkg.ReasonAutonomyNoActiveLease, toolspkg.ErrToolConflict |
| 5032 | case taskpkg.AutonomyLeaseExpired: |
| 5033 | return toolspkg.ErrorCodeConflict, toolspkg.ReasonAutonomyLeaseExpired, toolspkg.ErrToolConflict |
| 5034 | case taskpkg.AutonomyLeaseAlreadyHeld: |
| 5035 | return toolspkg.ErrorCodeConflict, toolspkg.ReasonAutonomyLeaseAlreadyHeld, toolspkg.ErrToolConflict |
| 5036 | default: |
| 5037 | return toolspkg.ErrorCodeConflict, toolspkg.ReasonAutonomyLeaseExpired, toolspkg.ErrToolConflict |
| 5038 | } |
| 5039 | } |
| 5040 | |
| 5041 | func trimNativeStrings(values []string) []string { |
| 5042 | if len(values) == 0 { |
no outgoing calls
no test coverage detected