Changeset - f49e1b6cff90
[Not reviewed]
default
0 1 0
domruf - 8 years ago 2017-08-08 22:43:11
dominikruf@gmail.com
logging: log wrong value for page number

This should not happen and "Errors should never pass silently".
If it happens anyway, we should have some record it.
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/page.py
Show inline comments
 
@@ -14,13 +14,15 @@
 
"""
 
Custom paging classes
 
"""
 

	
 
import logging
 
import math
 
import re
 
from kallithea.config.routing import url
 
from webhelpers.html import literal, HTML
 
from webhelpers.paginate import Page as _Page
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class Page(_Page):
 
    """
 
@@ -188,6 +190,7 @@ class RepoPage(Page):
 
        try:
 
            self.page = int(page)  # make it int() if we get it as a string
 
        except (ValueError, TypeError):
 
            log.error("Invalid page value: %r" % page)
 
            self.page = 1
 

	
 
        self.items_per_page = items_per_page
0 comments (0 inline, 0 general)