Message returns a user-friendly error message for the given code.
()
| 60 | |
| 61 | // Message returns a user-friendly error message for the given code. |
| 62 | func (c QueryErrorCode) Message() string { |
| 63 | switch c { |
| 64 | case ErrorCodeSavedSearchNotFound: |
| 65 | return "Saved search not found." |
| 66 | case ErrorCodeHotlistNotFound: |
| 67 | return "Hotlist not found." |
| 68 | case ErrorCodeSavedSearchCycleDetected: |
| 69 | return "Saved search cycle detected." |
| 70 | case ErrorCodeSavedSearchMaxDepthExceeded: |
| 71 | return "Saved search max depth exceeded." |
| 72 | case ErrorCodeQueryGrammar: |
| 73 | return "The query contains grammar errors." |
| 74 | case ErrorCodeFeatureNotFound: |
| 75 | return "Feature not found." |
| 76 | case ErrorCodeInvalidQuery: |
| 77 | return "Invalid query." |
| 78 | case ErrorCodeUnknown: |
| 79 | fallthrough |
| 80 | default: |
| 81 | return "An unknown error occurred while processing the query." |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | type Feature struct { |
| 86 | ID string |
nothing calls this directly
no outgoing calls
no test coverage detected