Skip to content

Error handling - chapter pages not in the database #13

@lb803

Description

@lb803

If chapter pages are not defined in the DB (i.e. data is incomplete), python throws a puzzling/not helpful error at this line:

page_range = re.split('-|–', chapter.get("pages"))

My take is to turn the Chapter class attribute pages into a list, store page range there and format it correctly when the object is first created (so this is done at api level and the "user" doesn't need to worry about it i.e. in the main.py file). If page data is not present then, throws an error with a nice message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions