Remove usages of die() from the API cache

Review Request #7298 — Created May 13, 2015 and submitted

Information

RBTools
release-0.7.x
f881b5f...

Reviewers

All usages of die in the HTTP cache for the API have now been
replaced to raise a new exception, CacheError, instead.

The --cache-location flag is now accepted by clearcache and the
--disable-cache flag (which was added by mistake) was removed.

Ran unit tests.

Description From Last Updated

What do you think about moving this into errors.py?

chipx86chipx86

Let's build the message in each case, and then do the super() at the end only once.

chipx86chipx86

e should be on the next line. Also, the error should be in sentence casing. Same with the others below.

chipx86chipx86

local variable 'e' is assigned to but never used

reviewbotreviewbot

I thought it was okay having this in CacheError. What led to the move?

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/api/cache.py
        rbtools/commands/clearcache.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/cache.py
        rbtools/commands/clearcache.py
    
    
  2. 
      
chipx86
  1. 
      
  2. rbtools/api/cache.py (Diff revision 1)
     
     
    Show all issues

    What do you think about moving this into errors.py?

  3. rbtools/api/cache.py (Diff revision 1)
     
     
     
     
     
     
     
     
    Show all issues

    Let's build the message in each case, and then do the super() at the end only once.

  4. rbtools/api/cache.py (Diff revision 1)
     
     
     
    Show all issues

    e should be on the next line.

    Also, the error should be in sentence casing.

    Same with the others below.

  5. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/api/errors.py
        rbtools/api/cache.py
        rbtools/commands/clearcache.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/errors.py
        rbtools/api/cache.py
        rbtools/commands/clearcache.py
    
    
  2. rbtools/api/cache.py (Diff revision 2)
     
     
    Show all issues
     local variable 'e' is assigned to but never used
    
  3. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/api/errors.py
        rbtools/api/cache.py
        rbtools/commands/clearcache.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/errors.py
        rbtools/api/cache.py
        rbtools/commands/clearcache.py
    
    
  2. 
      
chipx86
  1. 
      
  2. rbtools/api/cache.py (Diff revision 3)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    I thought it was okay having this in CacheError. What led to the move?

    1. I'm avoiding introducing a circular dependency (because api.cache imports api.errors.CacheError and api.errors would import api.cache.APICache for APICache.DEFAULT_CACHE_PATH).

  3. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (a22856e)
Loading...