Angular unit testing Unhandled promise rejection: ObjectUnsubscribedError: object unsubscribed - unit-testing

while testing code facing Unhandled promise rejection: ObjectUnsubscribedError: object unsubscribed.
how can I solve this error?

Related

can the last state in a aws step function flow contain a catch statement?

I have a step functions orchestration flow and I want to do error handling in some of the states using the catch field. However, the catch field requires a Next assignment and therefore I am unable to include a catch field in my last state if i want my step function to run.
I would like to have a catch field in the last state of the flow but I am wondering if it is good practise to have a catch statement in the last state. When i introduce an ending state e.g. a Type:Succeed state the stepfunction is able to run. But this solution feels a bit hacky.
I have tried to set the value of Next in the catch field to End. But was thrown this error in cloudformation when it tried to update the stack.
Resource handler returned message: "Invalid State Machine Definition: 'MISSING_TRANSITION_TARGET: Missing 'Next' target: EndState at /States/last_jobs/Branches[0]/States/last_state/Catch[0]/Next' (Service: AWSStepFunctions; Status Code: 400; Error Code: InvalidDefinition; Proxy: null)" (HandlerErrorCode: InvalidRequest)
The purpose of Catch is so you can tell Step Functions to take a different action in response to a failure (after retries) as the default behavior will be to fail the execution. That action needs to be captured in the workflow, hence the need for this to point to another state where that action is described.
I'm not 100% sure what you are looking to accomplish with this catch block, but I suspect it's one of the following cases.
If you are looking to take further action to compensate, then you will need to add that to your workflow (e.g. another task or a wait state that re-enters into the existing flow).
If you are looking to provide a specific failure cause and / or error as opposed to the default you would get from the task failing, then you will need a Fail state with those specifics. And set that as Next for your Catch.
If you are looking to ignore this task failure and complete the workflow successfully, then you need a Succeed state that you can specify as Next for your Catch.

Ember: Uncaught Error: infinite rendering invalidation detected

I am getting below error while running one of my component:
Uncaught Error: infinite rendering invalidation detected
On doing some research, it says this is an issue with Ember but I am not sure, so any thoughts here are appreciated?
I am calling a service to return a promise and then doing promise.then(response) and if there is an error resolving the promise I am throwing an error.

What are the failure modes of transaction.atomic()?

I'm unclear on the exact behaviour of Django in the face of database serialization errors in transactions.
The docs transaction.atomic() docs don't specify this behaviour as far as I can tell.
If the DB hits a consistency error while committing a transaction (e.g. another transaction updated a value that was read in the current transaction), reading django.db.transaction.py, it looks like the transaction will rollback, and the DatabaseError will be raised to the calling code (e.g. the transaction.atomic() context manager). Is this correct?
And, more importantly, are there cases when the transaction could be rolled back without the transaction.atomic wrapper receiving an exception?
(Note that I'm not asking about DatabaseErrors that are raised inside the context manager, as the docs clearly explain what happens to them. I'm asking only about database errors which occur during the commit of the transaction, which occurs on exit of the context manager.)
If the DB hits a consistency error while committing a transaction ... it looks like the transaction will rollback, and the DatabaseError will be raised to the calling code (e.g. the transaction.atomic() context manager). Is this correct?
Yes, precisely.
Are there cases when the transaction could be rolled back without the transaction.atomic wrapper receiving an exception?
No. You can verify this from the code inside transaction.py where the only time a rollback is initiated is if DatabaseError is thrown. This is also confirmed in the documentation that you link to:
When exiting an atomic block, Django looks at whether it’s exited normally or with an exception to determine whether to commit or roll back.

Rails 4 not raising exception when callbacks fail

I get all the other active record error but when there is a callback failure, it goes on and saves the record while actions to be performed in callbacks have malfunctioned.
I am looking for a better way to debug this. A simple configuration would also help. If I can force exceptions to raise instead of being ignored in callbacks.

Log Handled Exceptions in ASP.NET with ELMAH

I'm using ELMAH for an ASP.Net web application and it works fine
but I need to log the handled exceptions but not manually , I do not want to write in the
try/catch block any code to log the exception with the ELMAH
is there any way to make custom solution to log exceptions that are handled in the code by
ELMAH
thanks alot
The best that can be done in this case is, in each catch block, rethrow the exception like this
try
{
.............
}
catch(Exception ex)
{
............
throw;
}
Elmah will handle the exception raised from the catch block as unhandled exception and will log it automatically.