PyJudge icon indicating copy to clipboard operation
PyJudge copied to clipboard

Raise error in proper places

Open theSage21 opened this issue 6 years ago • 5 comments

It might be a good idea to use abort(404, <reason>) in some places like

  • https://github.com/PyJaipur/PyJudge/blob/e3debe1e15447a6faac9d509e7ad5283731fa2c0/server.py#L89
  • https://github.com/PyJaipur/PyJudge/blob/e3debe1e15447a6faac9d509e7ad5283731fa2c0/server.py#L102

some places however don't require the error. For example this

  • https://github.com/PyJaipur/PyJudge/blob/e3debe1e15447a6faac9d509e7ad5283731fa2c0/server.py#L104

does not require an error.

theSage21 avatar May 16 '19 12:05 theSage21

I would like to take this issue, basically in this, instead of a statement "contest does not exist", we should raise an abort 404 page error ?

soumilk avatar May 25 '19 07:05 soumilk

that's the basic idea. you will need to find other places in the code where this has to be done.

theSage21 avatar May 25 '19 09:05 theSage21

ohk ... i am on it

soumilk avatar May 26 '19 06:05 soumilk

I have gone through the server.py and it seems that it has raised abort(404) at certain places already, couldn't find places which require error. Help required . And I thought to add a cool looking error page 404. Have a look, we can add it to the project.

Screenshot from 2019-05-26 14-29-27

soumilk avatar May 26 '19 09:05 soumilk

well, there are a few places where we are returning the string "contest inactive" or something like that. I was thinking if we could turn that into these pages it would be nice.

As for the 404 page it does look cool :heart_eyes: but you'll need to accomodate ALL error codes and not just 404 since that template gets called for ALL errors

theSage21 avatar May 26 '19 10:05 theSage21