plugAPI icon indicating copy to clipboard operation
plugAPI copied to clipboard

Errors in callback functions passed to playlist methods are mishandled

Open mortenn opened this issue 7 years ago • 2 comments

When managing playlists, if you have some error in your callback method, such as a missing module import in your own code, the bot will print 11 REST Warnings before giving the error back to the console.

Example:

06:48:16s 627ms [Warning]   [REST Warning]  Route: https://plug.dj/_/playlists/9084662/media/insert sendREST attempt 2/10
06:48:20s 673ms [Warning]   [REST Warning]  Route: https://plug.dj/_/playlists/9084662/media/insert sendREST attempt 3/10
06:48:26s 271ms [Warning]   [REST Warning]  Route: https://plug.dj/_/playlists/9084662/media/insert sendREST attempt 4/10
06:48:40s 841ms [Warning]   [REST Warning]  Route: https://plug.dj/_/playlists/9084662/media/insert sendREST attempt 5/10
06:49:07s 728ms [Warning]   [REST Warning]  Route: https://plug.dj/_/playlists/9084662/media/insert sendREST attempt 6/10
06:49:53s 825ms [Warning]   [REST Warning]  Route: https://plug.dj/_/playlists/9084662/media/insert sendREST attempt 7/10
06:51:55s 726ms [Warning]   [REST Warning]  Route: https://plug.dj/_/playlists/9084662/media/insert sendREST attempt 8/10
06:55:44s 864ms [Warning]   [REST Warning]  Route: https://plug.dj/_/playlists/9084662/media/insert sendREST attempt 9/10
07:00:10s 859ms [Warning]   [REST Warning]  Route: https://plug.dj/_/playlists/9084662/media/insert sendREST attempt 10/10
07:10:49s 242ms [Warning]   [REST Warning]  Route: https://plug.dj/_/playlists/9084662/media/insert sendREST attempt 11/10
07:10:49s 386ms [Error]     [REST Error]    Route: https://plug.dj/_/playlists/9084662/media/insert ReferenceError: logger is not defined Guest Mode: false

Needing to wait 12 minutes to get a ReferenceError from your own code is not condusive to rapid development ;)

mortenn avatar Oct 10 '17 19:10 mortenn

issue should be resolved with https://github.com/plugCubed/plugAPI/commit/6b449073cf149759b17ef23c6dd641580b8beedd

Will release once done fixing other bugs that pop up

thedark1337 avatar Oct 11 '17 23:10 thedark1337

Hasn't this landed?

mortenn avatar Dec 06 '18 22:12 mortenn