GithubHelp home page GithubHelp logo

Comments (7)

alganet avatar alganet commented on May 7, 2024

Implementation details (just for me to remember): The process of creating the exception on the AbstractRule will check if the user has setException on that validator.

The ValidationException and it's children will have to deal with unknown exception classes on the chain possibly introduced by this technique. These custom exceptions will be the last leaf of the branches they are, since it's not possible to inspect them further.

The tell() method is just a façade for building validators, exceptions and binding them in the two distinct decoupled hierarchies.

from validation.

jeanpimentel avatar jeanpimentel commented on May 7, 2024

Very nice!
πŸ‘

from validation.

nickl- avatar nickl- commented on May 7, 2024

I was toying with interfaces and constants which we can extend and not have to duplicate the effort for similar messages. It does not support an array though but we can use the keys, as per the current implementation.

@algonet, your suggestion is for custom messages if I am right?

Something that really bugged me was the tokens being replaced via public properties on the rule class which seems very hackish. We could equally simple use a collection of tokens or abstracted to a token class with static token list and the replacement functionality included, allowing us to obfuscate the public properties instead.

This can then provide a list of replacement tokens which you can use in your custom messages too.

from validation.

xavadu avatar xavadu commented on May 7, 2024

that is working?
i am user develop branch, but doesn't work for me,

Which type of exeption should go in the catch() ?

from validation.

nickl- avatar nickl- commented on May 7, 2024

@xavadu this is a brainstorming ideas to implement still. Is there something you would like to add?

from validation.

xavadu avatar xavadu commented on May 7, 2024

Thanks @nickl- , i use it in an old project but was okay,
i remeber that this type of validation could be useful

from validation.

nickl- avatar nickl- commented on May 7, 2024

@xavadu glad you came right =)

from validation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.