Combining Error with Value in an Effect

I have this tiny snippet at the end of a pipe to resolve all errors into responses before running runPromise
        Ef.mapError((e) => ({
            'ParseError': new Response('Bad Request', { status: 400 }),
            'OrganizationNotFound': new Response('Not Found', { status: 404 }),
            'DatabaseError': new Response('Internal Server Error', { status: 500 }),
        }[e._tag])),
        Ef.match({
            onSuccess: (response) => response,
            onFailure: (response) => response,
        }),

Is there a shorthand way for first mapping the error to the type of value and then combining them? Any help would be appreciated!
Was this page helpful?