Fix WebAPI errors returning empty messages

Review Request #7415 — Created June 12, 2015 and submitted

Information

Review Board
release-2.0.x
d2948c9...

Reviewers

Previously, the WebAPI would sometimes return a empty error. This was
because we were referring to the msg attribute of the underlying
exception, instead of casting it to a text type.

Also fix some typos that were introduced in the errors module.

Unit tests have been introduced to test the behaviour of raising a
ReopenError, CloseError, and PublishingError during a review
request reopen, close, and publish, respectively.

Ran unit tests.

Description From Last Updated

Col: 54 E241 multiple spaces after ','

reviewbotreviewbot

Col: 45 E127 continuation line over-indented for visual indent

reviewbotreviewbot

Col: 1 E302 expected 2 blank lines, found 1

reviewbotreviewbot

local variable 'draft' is assigned to but never used

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/webapi/resources/base_review.py
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/resources/review_reply.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/webapi/resources/base_review.py
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/resources/review_reply.py
    
    
  2. 
      
SM
  1. Ship It!
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/webapi/resources/base_review.py
        reviewboard/webapi/resources/review_reply.py
        reviewboard/reviews/errors.py
        reviewboard/webapi/resources/review_request.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/webapi/resources/base_review.py
        reviewboard/webapi/resources/review_reply.py
        reviewboard/reviews/errors.py
        reviewboard/webapi/resources/review_request.py
    
    
  2. 
      
SM
  1. Ship It!
  2. 
      
chipx86
  1. Guess we don't have unit tests around this. Can you add some? I want to be sure this can never happen again.

  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/webapi/tests/test_review_request.py
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/resources/base_review.py
        reviewboard/reviews/errors.py
        reviewboard/webapi/resources/review_reply.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/webapi/tests/test_review_request.py
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/resources/base_review.py
        reviewboard/reviews/errors.py
        reviewboard/webapi/resources/review_reply.py
    
    
  2. Show all issues
    Col: 54
     E241 multiple spaces after ','
    
  3. Show all issues
    Col: 45
     E127 continuation line over-indented for visual indent
    
  4. Show all issues
    Col: 1
     E302 expected 2 blank lines, found 1
    
  5. Show all issues
     local variable 'draft' is assigned to but never used
    
  6. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/webapi/tests/test_review_request.py
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/resources/base_review.py
        reviewboard/reviews/errors.py
        reviewboard/webapi/resources/review_reply.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/webapi/tests/test_review_request.py
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/resources/base_review.py
        reviewboard/reviews/errors.py
        reviewboard/webapi/resources/review_reply.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (cb5346f)