JaikuEngine Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Patch 34001: refactor of ApiExceptions (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
3 years, 8 months ago by termie
Modified:
3 years, 7 months ago
Reviewers:
ttt
CC:
SVN Base:
Visibility:
Public.

Description

refactor of ApiExceptions

Closed in r107 and r108

Patch Set 1

Patch Set 2 : remove api changes from this commit

Patch Set 3 : remove extra utils change

Patch Set 4 : missed one

Total comments: 12

Patch Set 5 : changes per review

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M actor/views.py View 1 chunk 17 lines 0 comments Download
M api/views.py View 4 chunks 64 lines 0 comments Download
M common/api.py View 1 2 3 4 39 chunks 461 lines 0 comments Download
M common/exception.py View 4 chunks 80 lines 0 comments Download
M common/util.py View 1 chunk 20 lines 0 comments Download

Messages

Total messages: 2
ttt
lg, just some minor nits http://rietku.appspot.com/34001/diff/1007/1008 File actor/views.py (right): http://rietku.appspot.com/34001/diff/1007/1008#newcode594 Line 594: % (request.user and ...
3 years, 8 months ago
termie
3 years, 8 months ago
updated per review

http://rietku.appspot.com/34001/diff/1007/1008
File actor/views.py (right):

http://rietku.appspot.com/34001/diff/1007/1008#newcode594
Line 594: % (request.user and request.user.nick or '(nobody)', view.nick))
On 2009/09/18 00:48:14, ttt wrote:
> neat

Done.

http://rietku.appspot.com/34001/diff/1007/1010
File common/api.py (right):

http://rietku.appspot.com/34001/diff/1007/1010#newcode68
Line 68: 
On 2009/09/18 00:48:14, ttt wrote:
> stray new line?

Done.

http://rietku.appspot.com/34001/diff/1007/1010#newcode334
Line 334: % (api_user and api_user.nick or '(nobody)', actor_ref.nick))
On 2009/09/18 00:48:14, ttt wrote:
> We're repeating this "user and user.nick or '(nobody)'" pattern and the error
> message. Can we do this in ApiOwnerRequired and similarly in
> ApiViewableRequired? We'll just pass the actor and the owned entity name to
the
> constructor.

Yeah, I considered it but it seemed to digress from the other exceptions quite a
bit so I was hoping to leave everything with the same interface until it seems
worth the readability changes (right now everything just takes a message and you
never have to keep track of which arguments should be sent or look somewhere
else to find out what the error message will be)

http://rietku.appspot.com/34001/diff/1007/1010#newcode539
Line 539: raise exception.ApiException('Invalid code')
On 2009/09/18 00:48:14, ttt wrote:
> while we're here, can we include the code in the message?

Done.

http://rietku.appspot.com/34001/diff/1007/1010#newcode544
Line 544: 'That mobile number has already been activated')
On 2009/09/18 00:48:14, ttt wrote:
> similarly the mobile number and the few places below

Done.

http://rietku.appspot.com/34001/diff/1007/1010#newcode905
Line 905: raise exception.ApiException("Invalid nick")
On 2009/09/18 00:48:14, ttt wrote:
> and include the bad nick in the message?

Added though I have the feeling this could never be hit (I think clean will
through an exception first)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Patches | This issue
This is Rietveld r