Cool, that makes sense, this was good background reading,
http://stackoverflow.com/questions/16138232/is-it-a-good-practice-to-use-try-except-else-in-python
On Feb 5, 2014 10:37 PM, "Larry Weya" <notifications@github.com> wrote:

> In onadata/apps/viewer/views.py:
>
> > @@ -711,11 +712,24 @@ def charts(request, username, id_string):
> >      except ValueError:
> >          lang_index = 0
> >
> > -    summaries = build_chart_data(xform, lang_index)
> > +    try:
> > +        page = int(request.GET.get('page', 0))
> > +    except ValueError:
> > +        page = 0
> > +    else:
> > +        page = max(page - 1, 0)
>
> @pld <https://github.com/pld> the way I see it is it need to be clear
> what could cause the exception, which is just the int() function "It is
> useful for code that must be executed if the try clause does not raise an
> exception" in the reference.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/onaio/onadata/pull/170/files#r9474662>
> .
>