return code 499 when user cancels request while a model is loading (#3955)

This commit is contained in:
Jeffrey Morgan
2024-04-26 17:38:29 -04:00
committed by GitHub
parent 7fea1ecdf6
commit bb31def011
2 changed files with 16 additions and 1 deletions

View File

@@ -442,7 +442,7 @@ func (s *llmServer) WaitUntilRunning(ctx context.Context) error {
select {
case <-ctx.Done():
slog.Info("context expired before server started")
return fmt.Errorf("timed out waiting for llama runner to start")
return fmt.Errorf("timed out waiting for llama runner to start: %w", ctx.Err())
case err := <-s.done:
msg := ""
if s.status != nil && s.status.LastErrMsg != "" {