League-of-Foundry-Developers / torch

Simple torch module for Foundry VTT
10 stars 20 forks source link

Suggestion for Helpful Error Message in Torch Module #87

Closed dugedog closed 2 weeks ago

dugedog commented 4 weeks ago

I’m fairly new to this, but I wanted to share something I encountered using the Torch module. I got the error "Loading User Sources Failed, JSON5: invalid character '<' at 1:1" whenever I right click on an Actor. After some digging, I realised it was because the JSON file for "Additional Light Sources" was missing (I'm not sure when it disappeared to). Maybe a message to the effect of "Error: Missing JSON File for Additional Light Sources. Please check the file path in Settings and ensure the file exists." would make it clearer.

Just a suggestion! Thanks for all the work on the module—I really appreciate it!

lupestro commented 4 weeks ago

I’m sure I had a test for a missing file in my suite. It should have picked up the 404 code from the fetch. I’ll double down on that.

You’re right - the message you get when it tries to read the error HTML contents as JSON is terribly confusing. All apologies.

lupestro commented 2 weeks ago

Fixed in 2.15.1, just published.

dugedog commented 1 week ago

Hi Ralph.

That new message looks clear. Thanks for updating that!

On Tue, Sep 3, 2024 at 5:01 AM Ralph Mack @.***> wrote:

Closed #87 https://github.com/League-of-Foundry-Developers/torch/issues/87 as completed.

— Reply to this email directly, view it on GitHub https://github.com/League-of-Foundry-Developers/torch/issues/87#event-14106611134, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG37NO6PT6DYSNG6K3T3R4LZUSYXRAVCNFSM6AAAAABMV6SIHSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUGEYDMNRRGEYTGNA . You are receiving this because you authored the thread.Message ID: <League-of-Foundry-Developers/torch/issue/87/issue_event/14106611134@ github.com>