I often run into `Resource monitor is terminating`...
# getting-started
f
I often run into
Resource monitor is terminating
errors during development. I'm assuming this is because the stack hasn't reached a final state after a failure or cancellation. I'm using the Automation API - is there any way I can safeguard against this error? Would checking the state of the stack work for this or inspecting the refresResult?
l
This tends to happen to me because promises are leaking. Check your code for unresolved promises?
f
I can most-definitely put a try-catch around the stack.up() call that I'm making. Is this just simply a catch and retry the call type of scenario?
I'm trying to use the automation API in a self-serve capacity, so ideally I'd like to do as many checks beforehand to avoid something like this.
l
That might help, I don't know enough about how to clean up promises. In my context, it's always due to an exception being thrown and the engine or unit test context ending prematurely. So putting a catch in the right place might help. It would probably have to be inside the stack/project code though, rather than around it?
f
Ah, that makes much more sense. I hadn't thought of adding catches or checks inside the program function - that may be what I'm looking for. I'll give that a shot, thanks 👍