Harden PromptKit upgrade integration
This commit is contained in:
@@ -173,9 +173,14 @@ func comparisonExecutionMessage(err error) string {
|
||||
if errors.Is(err, context.DeadlineExceeded) {
|
||||
return "profile execution deadline exceeded"
|
||||
}
|
||||
operation := "profile execution"
|
||||
var execution *profileExecutionError
|
||||
if errors.As(err, &execution) {
|
||||
return comparison.TruncateErrorMessage(execution.operation + " failed")
|
||||
operation = execution.operation
|
||||
}
|
||||
return "profile execution failed"
|
||||
var generation *promptexec.GenerationError
|
||||
if errors.As(err, &generation) && generation.StatusCode() > 0 {
|
||||
return comparison.TruncateErrorMessage(fmt.Sprintf("%s failed (HTTP %d)", operation, generation.StatusCode()))
|
||||
}
|
||||
return comparison.TruncateErrorMessage(operation + " failed")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user