Throw a useful error when loading a classic theme page#21
Throw a useful error when loading a classic theme page#21MatteoCampinoti94 merged 4 commits intoFurryCoders:mainfrom
Conversation
|
Yes the library only works with the "Modern" theme, it's in the requirements section of the readme :) But thank you for this PR! It's perfect! I'll fix a couple of styling "issues" and then merge it into the main branch for deployment :) |
|
PS: don't be alarmed by the failed pytest. The secrets necessary to run it are not accessible to third-party PRs, so it errors out. |
Sweet, thank you! Styling is for sure not my strength.
Which readme? I did a quick ctrl+f on the main github page before putting this in for "classic" and "modern", didn't see it. Not sure if I'm looking in the wrong place or not. |
|
My bad. There was a short paragraph about using the Modern theme to use the library, but I must have deleted it, maybe when the theme became the default? Can't remember x3 |
I don't entirely know what I'm doing with regards to creating a PR so sorry if all of this is wrong.
I found out that FAAPI does not support the classic theme. I'm assuming this is intentional, rather than there being a new bug with parsing classic theme pages. Based on that assumption, I added a quick check for if pages loaded the classic theme by checking an attribute in the body element, and an exception to go with it. Formerly loading a classic theme would return a login error, now it returns a classic theme error.
I see the other exceptions are quite terse, I don't know if those are intended to only be docstrings and never returned to the user or if they're supposed to be more user facing errors. I found, at least with my code, that the exception classes that just threw as "Exception" would return the error text while the ones that throw as "ParsingError" only returned the class name. In any case, I wrote it as a more verbose error message, feel free to change that if you want.