1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. GTA Network forum is now in archive mode.

Closed Client-side onResourceStart event doesn't handle errors gracefully

Discussion in 'Solved & Closed' started by Katalina, May 27, 2017.

  1. Katalina

    Katalina Member Developer

    Messages:
    23
    Likes Received:
    26
    Joined:
    May 14, 2017
    Title:
    Client-side onResourceStart event doesn't handle errors gracefully
    What's wrong?:
    Any uncaught exception in onResourceStart events will stop executing onResourceStart handlers
    What should normally happen?:
    Error should log, all other handlers should still fire (I guess?)
    How to reproduce the issue:
    file1.js
    Code:
    API.onResourceStart.connect(() => {
      API.sendChatMessage('file1.js')
      throw new TypeError('stopping all resource starts after this one')
    })
    

    file2.js

    Code:
    API.onResourceStart.connect(() => {
      API.sendChatMessage('file2.js')
    })
    
    Write any additional information (Use spoilers for images):
    It's possible this should instead be defined/documented behaviour if stopping on errors is intended.​
     

Share This Page