Skip to content

Throw a useful error when loading a classic theme page#21

Merged
MatteoCampinoti94 merged 4 commits intoFurryCoders:mainfrom
plum-pan:classic-handling
Oct 29, 2025
Merged

Throw a useful error when loading a classic theme page#21
MatteoCampinoti94 merged 4 commits intoFurryCoders:mainfrom
plum-pan:classic-handling

Conversation

@plum-pan
Copy link
Contributor

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.

@MatteoCampinoti94
Copy link
Collaborator

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 :)

@MatteoCampinoti94
Copy link
Collaborator

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.

@MatteoCampinoti94 MatteoCampinoti94 self-requested a review October 29, 2025 18:31
@MatteoCampinoti94 MatteoCampinoti94 merged commit 5e6cdba into FurryCoders:main Oct 29, 2025
6 of 7 checks passed
@plum-pan
Copy link
Contributor Author

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 :)

Sweet, thank you! Styling is for sure not my strength.

Yes the library only works with the "Modern" theme, it's in the requirements section of the readme :)

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.

@MatteoCampinoti94
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants