Slaynash / Lumbot

LUM Discord Bot
Other
18 stars 6 forks source link

[FEATURE REQUEST]: Add the ability to detect exceptions #23

Open Arkhorse opened 1 month ago

Arkhorse commented 1 month ago

Is your feature request related to a problem? Please describe.

LUM currently does not properly detect exceptions, which can lead to LUM saying that there are no issues when there are.

Describe the solution you'd like

Being able to detect and display the exception along with the thrown line would be pretty useful. So I made the regex for you to play with: (.*Exception).*\s{4}(?:at.)(.*\(.*\)) This will match any exception thrown, even custom ones. It uses two capture groups: The first one grabs the name of the exception (IE: System.NullReferenceException), with the second one grabbing the class name (including the namespace path and parameters (IE: Thing.NextThing.ClassName(string thing)) that threw the exception (I know, this wont always be the direct class). This regex will also detect the melon start screen issue's exception

Describe alternatives you've considered

Might also need to handle the 'during invoke trampoline' error as well

Additional context

No response

Arkhorse commented 1 month ago

How LUM could display it:

### Mods with Exceptions:
- `Class Capture Group` threw exception `Exception Capture Group` `[x3]`

[x3] is the number of times logged

Mods that support and use Complex Logger will always log which mod threw the exception, providing the mod authors properly use try catches.