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

Providing a way to replace the failure implementation #703

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shau-kote
Copy link

@shau-kote shau-kote commented Oct 27, 2023

Description

The given PR provides a way to replace the failure implementation used by the built-in codecs, like, t.string etc.

Goal

We want to use the current full-featured validation in the dev environment, but in the production we want to just log errors and go ahead "as is".

So the idea is to have an option to change the validation behaviour with a code like this.

import {success, setFailureImplementation} from ''

if (process.env.NODE_ENV !== 'development') {
  setFailureImplementation(value, context, message) => { 
    Logger.logError(context, message)
    return success(value)
  }
}

Please feel free to add your feedback, I'll do my best to fine-tune my PR>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant