37 lines
1.6 KiB
Go
37 lines
1.6 KiB
Go
package ai_summarizer
|
|
|
|
import "errors"
|
|
|
|
// Common sentinel errors for the AI summarizer package.
|
|
var (
|
|
// ErrSummaryNotReady is returned when the tender.json exists but
|
|
// summarize_status.done is still false.
|
|
ErrSummaryNotReady = errors.New("ai_summarizer: summary not ready yet")
|
|
|
|
// ErrNoOverallSummary is returned when the pipeline is done but
|
|
// overall_summary is empty or null.
|
|
ErrNoOverallSummary = errors.New("ai_summarizer: overall_summary is empty")
|
|
|
|
// ErrTranslationNotReady is returned when tender.json exists but the
|
|
// requested language is not listed in translation_status.done yet.
|
|
ErrTranslationNotReady = errors.New("ai_summarizer: translation not ready yet")
|
|
|
|
// ErrNoTranslation is returned when translation_status marks a language done
|
|
// but translations[language] is missing or empty.
|
|
ErrNoTranslation = errors.New("ai_summarizer: translation is empty")
|
|
|
|
// ErrObjectNotFound is returned when the tender.json object does not
|
|
// exist in the MinIO bucket (HTTP 404 / NoSuchKey).
|
|
ErrObjectNotFound = errors.New("ai_summarizer: tender.json not found in storage")
|
|
|
|
// ErrBucketNotFound is returned when the MinIO bucket does not exist.
|
|
ErrBucketNotFound = errors.New("ai_summarizer: bucket not found")
|
|
|
|
// ErrMinIOUnavailable is returned when MinIO cannot be reached (network,
|
|
// timeout, connection refused, etc.) as opposed to a missing object key.
|
|
ErrMinIOUnavailable = errors.New("ai_summarizer: MinIO connection unavailable")
|
|
|
|
// ErrAPINonSuccess is returned when the AI API returns a non-2xx status code.
|
|
ErrAPINonSuccess = errors.New("ai_summarizer: API returned non-success status")
|
|
)
|