Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jsdoc http exception #10

Merged
merged 2 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/hono-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,10 @@ class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends string =
/**
* `.fire()` automatically adds a global fetch event listener.
* This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers.
* @see https://hono.dev/api/hono#fire
* @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
* @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/
*
* @see {@link https://hono.dev/api/hono#fire}
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API}
* @see {@link https://developers.cloudflare.com/workers/reference/migrate-to-module-workers}
*/
fire = () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down
10 changes: 9 additions & 1 deletion src/http-exception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ type HTTPExceptionOptions = {

/**
* `HTTPException` must be used when a fatal error such as authentication failure occurs.
*
* @see {@link https://hono.dev/api/exception}
*
* @param {StatusCode} status - status code of HTTPException
* @param {HTTPExceptionOptions} options - options of HTTPException
* @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException
* @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException
* @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException
*
* @example
* ```ts
* import { HTTPException } from 'hono/http-exception'
Expand All @@ -27,7 +36,6 @@ type HTTPExceptionOptions = {
* await next()
* })
* ```
* @see https://hono.dev/api/exception
*/
export class HTTPException extends Error {
readonly res?: Response
Expand Down