exception handling for rest services

This commit is contained in:
rlawson
2014-08-09 20:11:20 -04:00
parent c306e338db
commit 897e47f926
4 changed files with 53 additions and 5 deletions

View File

@ -35,12 +35,12 @@ public class LessonMenuService extends BaseService {
@RequestMapping(value = "/lessonmenu.mvc", produces = "application/json")
public @ResponseBody
List<LessonMenuItem> showLeftNav(HttpSession session) {
//TODO - need Links, rank, title
if(true) throw new IllegalArgumentException("No valid session object found, has session timed out?");
List<LessonMenuItem> menu = new ArrayList<LessonMenuItem>();
WebSession ws;
Object o = session.getAttribute(WebSession.SESSION);
if (o == null || !(o instanceof WebSession)) {
return null;
throw new IllegalArgumentException("No valid session object found, has session timed out?");
}
ws = (WebSession) o;
AbstractLesson l = ws.getCurrentLesson();