def handle_dashboard_error(view):
 def wrapper(request, course_id):
  '\n        Wrap the view.\n        '
  try:
   return view(request, course_id=course_id)
  except DashboardError as error:
   return error.response()
 return wrapper

def handle_dashboard_error ( view ) : def wrapper ( request , course_id ) : try : return view ( request , course_id = course_id ) except DashboardError as error : return error . response ( ) return wrapper
decorator which adds seamless dashboarderror handling to a view .