ruipin/fvtt-lib-wrapper

[BUG] URL to faulty module's page is run-in with following sentence, merging the two

Closed this issue · 8 comments

Confirm you have read the above
The bug is in libWrapper's own error about it not being libWrapper error.

Describe the bug
"Report this issue here:" text is run in with previous URL, causing the "Report" part to be part of the URL.

Example of the bit in question:

Find information about this module here: https://gitlab.com/koboldworks/pf1/sheetReport this issue here:

Notice how Report is run-in with the URL?

To Reproduce
Steps to reproduce the behavior:

  1. Cause an error that libWrapper reports.

Expected behavior
The link to not include "Report" from the following sentence.

Screenshots
Screenshot 2022-11-14 170158

Technical Details (please complete the following information):

  • LibWrapper Version: 1.12.10.0
  • FoundryVTT Version: 10.290

Thank you so much for this detailed bug report! I don't have time right now to look into it, but I'll try to find some time this week.

What browser are you using?
Can you post the entire error message?

Also what version of the pf1 sheet module are you using? Any other requirements to see this exact message?

I am unable to reproduce, unfortunately. All such errors I can generate myself have the proper line-break at that position.
Code inspection does not show any obvious code path where this should be possible, so I am probably missing something.

It appeared while I was developing the module more and I caused bugs.

PF1 0.82.2, Foundry 10.290 with Electron client, Win10,...

I don't think there's anything unusual about the URL field either to cause it: https://gitlab.com/koboldworks/pf1/sheet/-/blob/master/release/module.json#L37

What was the exact exception type?

For instance, LibWrapperPackageError or LibWrapperAlreadyOverriddenError?

They have different code paths for the message, so it would help narrow it down.

That I do not remember. And I don't remember what the error itself was. I can try making something break, I guess.

Nevermind, I think I found the problem. Thanks for the help!

Well, for post-humous reasons...
This is probably what caused the error at least.

const registerSheetOverride = () => {
	if (!game.settings.get(CFG.id, CFG.SETTINGS.defaultInfoSheet)) return;
	/* global libWrapper */
	libWrapper.register(CFG.id, Item.prototype._getSheetClass, softOverrideDefaultSheet, libWrapper.MIXED);
}

Hooks.once('init', registerSheetOverride);

Missing quotes on the override target.

Screenshot 2022-11-15 161516

Fixed in v1.12.11.0. Thanks for your help!

Turns out I had broken this in v1.12.9.0.

Closing this, let me know if you encounter this again.