williamareynolds/grumpus

Create a non-functional interface

Opened this issue · 1 comments

The non-functional interface should return unwrapped data and throw exceptions.

I think the name for this api will be unsafe.

import { checkEndpoint } from 'grumpus/unsafe'

Calling something unsafe in FP seems to be the common way to indicate that exceptions can be thrown during execution. A big question is this: should all of the detail from the original error be thrown away, or should the Failure type extend or mix with AxiosError? The latter seems really restrictive. Since this is a testing library, it might make sense to write the full error to console.error or use console.dir to ensure full depth.