Add error handling to cartController