Code Monkey home page Code Monkey logo

Comments (9)

thousandsofthem avatar thousandsofthem commented on August 21, 2024

#16

from airbrakex.

fazibear avatar fazibear commented on August 21, 2024

I think there is no legit execptions. Every exception will terminate process. I think when you code throws exceptions at runtime is really bad. It means that something happened that you don't expect, and you should take care of it, not hide.

With this feature you'll miss things that should never happened.

from airbrakex.

thousandsofthem avatar thousandsofthem commented on August 21, 2024

I think there is no legit execptions.

My real usecase:
Phoenix, getting 404 on some random request (various bots love to do that)
e.g. GET /randomcrap -> Phoenix.Router.NoRouteError

What's the right solution?

usecase # 2: getting record by ID.
e.g.

 def show(conn, %{"photo_id" => photo_id}) do
    photo = Repo.get!(Photo, photo_id)
    ...

Code is clear and self-describing. if photo is not found - fail, show error. but i do not want to see similar errors in the error tracker (in many cases endusers can try random ids etc)

What's the right solution?

from airbrakex.

joshuaswilcox avatar joshuaswilcox commented on August 21, 2024

I agree, I would like be able to ignore certain errors, esp 404s from bots

from airbrakex.

fazibear avatar fazibear commented on August 21, 2024

I'm still not get it. Why you want to ignore exception instead of catch it and handle them ?

In case of 404 you can make your own beautiful not found page.
If you want to get data from data base, and expect that you won't find any items, user Repo.get instead of Repo.get! and process both cases.

Of course we can't implement that, but application should work without throwing exceptions, because this is exceptions and should not accurs. Will loog at this RP once again later.

from airbrakex.

joshuaswilcox avatar joshuaswilcox commented on August 21, 2024

Because with a 404 page it still send the error since Elixir.Phoenix.Router.NoRouteError is raised

from airbrakex.

fazibear avatar fazibear commented on August 21, 2024

What about catch_errors: true ?

from airbrakex.

joshuaswilcox avatar joshuaswilcox commented on August 21, 2024

No that does not work either

from airbrakex.

fazibear avatar fazibear commented on August 21, 2024

Merged!

from airbrakex.

Related Issues (17)

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.