[OneSignal Plugin] Error is handled wrongly using missing variable "message"

[OneSignal Plugin] Error is handled wrongly using missing variable "message"

  
Forge Component
(5)
Published on 23 Nov (3 weeks ago) by OutSystems R&D
5 votes
Published on 23 Nov (3 weeks ago) by OutSystems R&D

Hi,

On PostNotificationJSAction postNotification Fail callback function uses missing variable message when actual error messages are in failedResponse.errors array


function Fail(failedResponse) {

    console.log(failedResponse);

    $parameters.Success = false;

    $parameters.ErrorCode = 1;

    $parameters.ErrorMessage = message;

    $resolve();

}

Should be at least this   $parameters.ErrorMessage = failedResponse.errors[0]

Otherwise there is not actual error on console log but undeclared variable...

Hello Nick.

Nice catch! It will be fixed in the next version.

Thanks