GithubHelp home page GithubHelp logo

Comments (6)

harikt avatar harikt commented on July 23, 2024

I assume the user can catch the exception and do add the needful messages via Aura.Intl or add to Aura.Filter or some other way.

from aura.auth.

pmjones avatar pmjones commented on July 23, 2024

It is partially an I18N issue, yes. The idea is that the package should only throw the exception, and the end-user (developer) can do whatever is needed with the exception.

Hope that makes sense.

from aura.auth.

quasipickle avatar quasipickle commented on July 23, 2024

Adding a message doesn't stop the developer from doing anything at all with the exception. What it does do though, is prevent a generic catch-all exception catch. Rather than just output the message, I have to catch every possible type of exception, then act accordingly.

It's certainly not the end of the world, but I think it does affect the usability of the library.

from aura.auth.

harikt avatar harikt commented on July 23, 2024

@quasipickle if I understand you,

You are looking to add some message on throwing an exception?

throw new Exception\PasswordIncorrect('Password is incorrect.');

that way you can use

try {
    // auth stuffs
} catch (Exception $e) {
    echo $e->getMessage();
}

I don't have any trouble to add a generic message, send a PR if you like or ask Paul if this is what you are looking for.

Thanks

from aura.auth.

harikt avatar harikt commented on July 23, 2024

ask Paul in the sense before you send the PR whether he likes the approach or not.

from aura.auth.

quasipickle avatar quasipickle commented on July 23, 2024

@harikt You understand correctly.
@pmjones How does this sound?

from aura.auth.

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.