gristlabs/ts-interface-checker

Make message public

drexseoj opened this issue · 2 comments

This is feature request.

Could it be possible to make the error message public. In this way it will be easier to get the and log the message when it is thrown.
So changing line 6 in lib/util.ts from
constructor(public path: string, message: string) {
to
constructor(public path: string, public message: string) {

then then the message can be retried in a catch block by err.message

I think it's already possible, since VError extends Error whose .message property is public. Could you share a piece of code where this would make a difference?

Closing since err.message as thrown from the checker checks is already public.