> All web requests (by pure chance) checked out fine
This sounds like you're doing some kind of sticky sessions, where the same request from the same client is routed to the same worker.
Using error tracking is a good way to determine if you've broken a particular path or one of your workers died. This can be implemented in a number of ways:
Scraping your logs and looking for 500 errors, then pushing it to a monitoring system that alerts when it breaches a threshold
Directly pushing to your monitoring system when a 5xx error occurs and alerting when a threshold is breached
Using a paid service like Rollbar which implements a client library that pushes all errors to a central system and can be configured to alert you when there are several exceptions. This also provides an easy way to trace user errors to find more transient issues.
Have you heard of Rollbar? I haven't tried it yet, but from what I understand they catch errors like that and notify you. There's a free tier, but even if you're above that level I wonder if they wouldn't donate the service to you given your mission.
Looking back at my code I screwed up when I put in the “type hint” of Exception.
You could remove that, or the correct way would have been \Exception.
This has absolutely nothing to do with Netbeans or with any other IDE.
> must be caught or declared to be thrown
Here, you have your answer.
The method you are trying to call might throw an exception of type AWTException
. (This is indicated in the <em>documentation</em> and in the source code by throws AWTException
.)
Your calling method as of now just ignores the potentially thrown exception.
You need to implement <em>exception handling</em> (try
...catch
) or bubble up the exception further (again by adding throws AWTException
). In the latter case, you still need to somewhere handle the exception.
Depends if the feature is critical or optional nice to have
If it's a critical service for your product to work then you don't need consent but you do need to declare it in your privacy notice. I would also consider asking them about a DPA (Data Processing Agreement) Since you would be the data controller and them the data processor, the DPA can govern how they can use your personal data and cannot sell or using it outside what they already said they do with it. Several of my services I use already offer DPA for their clients to use. https://rollbar.com/ is one of them
If it's an optional feature/service where the user doesn't need to use that feature to make your product work. Then I would have a option for the user to turn that feature on and have consent request stating that using this optional feature shares data with Imgix giving the user the choice.
The bulk of the javascript portion is actually handled by Rollbar’s Javascript integration, here: https://rollbar.com/docs/notifier/rollbar.js. ng-rollbar isn’t compatible with Angular 2, but it should be fairly straightforward to create a simple wrapper for it. There’s an even simpler Angular 1 integration that could be a good source of inspiration: https://github.com/anotherpit/angular-rollbar/blob/master/angular-rollbar.js
You are making a distinction without a difference. It doesn’t matter what you can do in C. Nobody seriously considers C to be a statically typed language. Its type system is basically a bunch of ints in a trenchcoat, pretending to be types.
It doesn’t matter that Python raises a runtime error where JavaScript doesn’t for this specific example. It’s still a runtime type error. That’s exactly what static typechecking totally eliminates.
> Which means that ‘just add static type annotations’ does not automatically clear…
No, it doesn’t mean that. In fact the ‘To type or not to type’ paper shows the exact opposite of that conclusion, by catching that weak typing bug with static typechecking.
But that’s not even the only point. JavaScript also has strong typechecking for certain operations, e.g. the infamous ‘undefined is not a function’ error which obviously does not silently fail, and loudly throws a runtime error. And as you can see, it (and similar type errors) are the leading runtime errors reported to the metrics collection platform Rollbar: https://rollbar.com/blog/top-10-javascript-errors-from-1000-projects-and-how-to-avoid-them/
Static typechecking would have caught all of those too.
You could try Rollbar. I think its the #1 most popular error tracking tool. You wouldn't have to connect to their network, but your data would still be uploaded externally to rollbar.com. Would this be acceptable to your client? You could do equally as well with the managed Sentry offering.
Well, instead of going through the list of all the things I have done with AWS - AWS is massive, I have five certs, experience in most of the areas covered and I still have only scratched the service.I think it would be more instructive to talk about the basics. I’m coming from a bog standard setting up an enterprise level software as a service web hosted solution. But a lot of the same applies to back end services for a mobile app or an IOT implementation. Also, a lot of the core concepts are the same across cloud providers and hosting on prem.
Setting up a network:
https://blog.rackspace.com/aws-201-understanding-the-default-virtual-private-cloud
AWS Well Architected Frameworks
https://aws.amazon.com/architecture/well-architected/
Deployment strategies.
https://rollbar.com/blog/iOS-error-monitoring
You don’t have to be an expert at all of the areas but you should at least know the basics.
Depending on what you are deploying you should know the process of getting it to production.
We use Rollbar to collect and notify log entries and errors. It has a ready-made Laravel integration and a free tier for up to 5,000 entries per month.
Can also set up alerts via email and slack etc.
The easiest thing to do is to use a third party logging service such as sentry or rollbar. The integration with these services are quite easy - just a few lines of JS code.
You also have the option to use a hosted service such as splunk but that is more for enterprise apps and a bit too heavy for smaller apps. I wouldn't write my own system for handling logs unless I had very specific needs.
Try looking at either of these:
Https://rollbar.com Https://logrocket.com
They are both 3rd party web applications that allow for in depth logging (and visualisation) of your application. Hope it helps!
I should add: fundamentally, your logic seems sound to me, but my experience is that in practice, NoMethodError: undefined method `whatever' for nil:NilClass
is probably the most common type of error I get, and judging by Rollbar's list of top 10 Rails errors, I'm not alone. ActionController::ParameterMissing
and undefined local variable
are basically variants on the same type of error, too.
Yes, good design can prevent a lot of these errors, but as has been mentioned by others, static typing is great for when there are people of different competence levels, for example; and even then, senior developers still make these mistakes, because we're all human.
That said, you could argue that the number of occurrences on Rollbar's 1000+ Rails projects shows that they aren't that common, as even the most common, NoMethodError: undefined method `[]' for nil:NilClass
only occurred 1016 times.
However, it's unknown during what time frame Rollbar are talking about, and this doesn't take into account that the same error (NoMethodError: undefined method `whatever' for nil:NilClass
and NoMethodError: undefined method `[]' for nil:NilClass
are the same, but NoMethodError: undefined method `whatever' for nil:NilClass
, or hell NoMethodError: undefined method `whatever' for "whatever":String
) will be scattered amongst many names amongst the rest of the errors that don't reach the top 10 and even the same fundamental type of error under a different class, like ActionController::ParameterMissing
, will also be scattered.
+1 for Papertrail (if you are okay with external logging services)
Also try https://rollbar.com/ for error logging. I've managed to install and deploy it in 2 minutes. Now tracking both JavaScript and Python-backend errors at the same place.
Thanks everyone for your input. After gathering several answers and info, here's what I went with, in case this helps anyone in the future:
To solve problem one, I've started using Rollbar for a better way to roll up exceptions in a pretty dashboard. exception_notification gem is great, but Rollbar is more sophisticated and will save my inbox. I send exceptions to Rollbar in the rescue block, and gracefully handle the return variables to let the user know something went wrong.
For problem two, I was advised to capture StandardError, not Exception. Here's a good post explaining why.