Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't catch cooldown error #13

Closed
saig0 opened this issue Dec 22, 2023 · 1 comment · Fixed by #17
Closed

Can't catch cooldown error #13

saig0 opened this issue Dec 22, 2023 · 1 comment · Fixed by #17
Assignees
Labels
bug Something isn't working as intended

Comments

@saig0
Copy link
Contributor

saig0 commented Dec 22, 2023

Describe the bug
I use the SDK to extract resources. If a ship extracts resources and the mining laser has a cooldown then the operation fails.

I want to handle the failure case in the process via error event. But currently, I can't catch the error and an incident is created with the message:

409 Conflict
POST https://api.spacetraders.io/v2/my/ships/SG_18_1-3/extract
{"error":{"message":"Ship action is still on cooldown for 30 second(s).","code":4000,"data":{"cooldown":{"shipSymbol":"SG_18_1-3","totalSeconds":70,"remainingSeconds":30,"expiration":"2023-12-22T13:39:48.194Z"}}}}

To Reproduce
Steps to reproduce the behavior:

  1. Use the SDK to extract resources two times without waiting in between
  2. Verify that an incident is created

Expected behavior
I can catch the cooldown error with the error code cooldownConflictError in the BPMN error event.

Environment

  • SDK/Connector template version? 4

Additional context

@saig0 saig0 added the bug Something isn't working as intended label Dec 22, 2023
@saig0 saig0 self-assigned this Feb 5, 2024
@saig0 saig0 mentioned this issue Feb 8, 2024
@saig0
Copy link
Contributor Author

saig0 commented Feb 8, 2024

Resolved by #17. 🚀

@saig0 saig0 closed this as completed Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant