| 70 | } |
| 71 | |
| 72 | export const lighthouseUnreachable = (url: string, error: unknown): ServiceError => { |
| 73 | const detail = error instanceof Error ? error.message : String(error); |
| 74 | return { |
| 75 | statusCode: StatusCodes.SERVICE_UNAVAILABLE, |
| 76 | errorCode: ErrorCode.LIGHTHOUSE_UNREACHABLE, |
| 77 | message: `Could not reach the Sourcebot licensing service at ${url}. ` |
| 78 | + `Verify this host has outbound network access to it, then try again. Details: ${detail}`, |
| 79 | }; |
| 80 | } |
| 81 | |
| 82 | export const notAuthenticated = (): ServiceError => { |
| 83 | return { |