diff --git a/api/index.ts b/api/index.ts index 0534237d..02295956 100644 --- a/api/index.ts +++ b/api/index.ts @@ -1,7 +1,7 @@ import { Card } from "../src/card.ts"; import { CONSTANTS, parseParams } from "../src/utils.ts"; import { COLORS, Theme } from "../src/theme.ts"; -import { Error400 } from "../src/error_page.ts"; +import { Error200 } from "../src/error_page.ts"; import "https://deno.land/x/dotenv@v0.5.0/load.ts"; import { staticRenderRegeneration } from "../src/StaticRenderRegeneration/index.ts"; import { GithubRepositoryService } from "../src/Repository/GithubRepository.ts"; @@ -63,7 +63,7 @@ async function app(req: Request): Promise { if (username === null) { const [base] = req.url.split("?"); - const error = new Error400( + const error = new Error200( `

"username" is a required query parameter

diff --git a/src/error_page.ts b/src/error_page.ts index 7b1acb9d..87cd3531 100644 --- a/src/error_page.ts +++ b/src/error_page.ts @@ -11,6 +11,7 @@ abstract class BaseError { + GitHub Profile Trophy + -

${this.status} - ${this.message}

+

${this.message}

${this.content ?? ""}

${ this.content && @@ -114,6 +116,11 @@ abstract class BaseError { } } +export class Error200 extends BaseError { + readonly status = 200; + readonly message = ""; +} + export class Error400 extends BaseError { readonly status = 400; readonly message = "Bad Request";