Skip to content

Do not throw errors, use callbacks in all errror and success cases #1

@bengtweisse

Description

@bengtweisse

Hey there,

you are throwing errors in some cases (like during message creation by default).
Please do not do this, because it will destroy async apps and nodejs lives from async!

if i deactivate websms.doThrowMessageCreationError then the error callback is async, but the success is sync. So I have to check on my own if the createdMessage is corrupt, because the error callback triggers later then the message sending.

It would be nice to have there a success and error callback.
So i can handle it not as dirty i have to do it, yet.
I could use a promise or put the sending block in the success callback of the creation statement.

In general nodejs approaches.
You may also use one callback for each websmscom function.
First argument would be the error or null/undefined and the second argument the successobject (created message or success of sending a message).

Thank you.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions