Ember.js: how to catch all JS errors thrown by a component - ember.js

using ember v3.5, is there a way to catch all JS errors thrown by a component (ex errors thrown in computed fields without having to use try-catch in all computed fields)?
Thank you!

Related

How to define django app specific exception handler

For my django app I am creating a custom exception handler as defined in https://www.django-rest-framework.org/api-guide/exceptions/#custom-exception-handling
Is there a way to define REST_FRAMEWORK variable in some app specific settings file instead of global settings.py
No, there is no app specific exception handling, you can get things like view, request etc.. through custom exception handler and handle it with if-else block
The context argument is not used by the default handler, but can be useful if the exception handler needs further information such as
the view currently being handled, which can be accessed as
context['view'].

Getting 'Could not load NIB in bundle' error

I'm creating a framework that makes a RESTful call to a web-server and returns a custom UITableView. The iOS client imports my framework and makes an instance of the one public class and calls the one method to return an UITableView.
However I am getting an "NSInternalInconsistencyException: 'Could not load NIB in bundle'" error and can't seem to figure out what's causing the error:
I have the default tableview cell created via xib in my framework and in my custom tableview class, I register the cell in my viewDidLoad():
It compiles fine in my framework but whenever I try to use the method to get a tableview, I'm getting the error. Any idea what's the issue?
Few things I tried / checked:
Made sure that my xib's target is selected to be the framework's.
Found the solution for my error.
Not sure if my understanding / explanation is correct but I need to register the UINib to the class that is going to be using the custom tableview cells.

Controller Creation Exception

I am getting Controller Creation Exception When rendering controller in sitecore. Please see screen shots below:
Layout where exception is thrown:
Footer Controller Code:
Base Controller Code:
Sitecore Controller Rendering:
Am I doing anything wrong, Can someone suggest what could be the issue and a fix for it?
What happens if you just put your "controller name" in controller.
Controller: Footer
Controller Action: RenderFooter

Prevent error of missing handler in controller

How can we normally prevent Nothing handled the action error in generic view implementation.
Currently I am reopening controller class and adding empty handler but again if I put it directly Ember throws deprecation message Action handlers implemented directly on controllers are deprecated if I add it in action object it is "not working" (probably overridden) and throws error as if it is not in base controller. Any ideas? Thanks.
If you want a somewhat hacky way to do it, you can add the method to the _actions object on the controller. That's where Ember internally keeps all of the actions for an object. Unfortunately, there's no other way to really handle an unused action from a view. This issue suggested a feature that would allow you to, but it hasn't been implemented yet.
Personally, I don't use straight views at all, I only use components. Components allow you to subscribe to particular events (let them bubble up) and ignore the others completely.

TransitionTo and the new Ember Router

The new ember router has been throwing me for a loop. Does anyone know how to manually triggering a url change when you are (1) NOT using a redirect in the router (2) NOT using the linkTo helper?
It seems that this:
App.container.lookup('router:main').router
no longer works, as of today's build.
This seems hard to do in new ember router because ember is working hard to prevent you writing code in this style. Rather than access an instance of the router (or anything else) via App your ember application code should be working with properties that have been injected at runtime by the framework. As #sly7_7 mentioned above, your view will have access to the controller and controller can trigger a transition like:
view.get('controller').transitionTo('state')
Depending on how your third party library is working, you might do this by triggering an event in the dom (handled by the view) or by registering a callback when the view is rendered from within didInsertElement
The main thing to remember is that App.anything-in-lowercase is generally bad practice. Whenever possible try to let the framework take care of instantiating and wiring together your application classes.
For more detail, see the notes on this commit: https://github.com/emberjs/ember.js/commit/5becdc4467573f80a5c5dbb51d97c6b9239714a8
You can try this:
App.__container__.lookup('router:main').transitionTo('name_of_your_route');