1 /* 2 Copyright 2023 The cert-manager Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package signer 18 19 // PendingError should be returned if we are certain that we will converge to a 20 // successful result or another type of error in a finite amount of time by 21 // just retrying the same operation. 22 // 23 // It can be used to circumvent the MaxRetryDuration 24 // check, which is useful for example when the signer is waiting for an async 25 // answer from an external service that is indicating that the request is still 26 // being processed. 27 // 28 // > This error should be returned only by the Sign function. 29 type PendingError struct { 30 Err error 31 } 32 33 var _ error = PendingError{} 34 35 func (ve PendingError) Unwrap() error { 36 return ve.Err 37 } 38 39 func (ve PendingError) Error() string { 40 return ve.Err.Error() 41 } 42