Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Subapp error handler is not respected #12

@v1rtl

Description

@v1rtl

Reproduction:

import { App } from 'https://denopkg.com/deno-libs/tinyhttp@master/mod.ts'
import { makeFetch } from 'https://deno.land/x/superfetch@1.0.4/mod.ts'

const app = new App({
  onError: (err, req) =>
  new Response(`Ouch, ${err} hurt me on ${req?.url} page.`, {
    status: 500,
  })
})

const subApp = new App({
  onError: (err, req) =>
  new Response(`Handling ${err} from child on ${req?.url} page.`, {
    status: 500,
  })
})

subApp.get('/route', async (req, res, next) => await next('you'))

app.use('/subapp', subApp)

const server = app.handler
const fetch = makeFetch(server)

const res = await fetch('/subapp/route')
res.expectStatus(500).expectBody('Handling you from child on /subapp/route page.')

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions