public class CanvasErrorResponse extends Object
For some errors, Canvas returns JSON error strings that can be parsed and displayed to the user. There isn't much documentation on exactly how these messages are structured but here is an example of something that is returned (along with an HTTP 400 in this case) if a student tries to submit answers to a quiz that they are not authorized to participate in:
{"status":"bad_request","message":"you are not allowed to participate in this quiz","error_report_id":9005006}| Modifier and Type | Class and Description |
|---|---|
class |
CanvasErrorResponse.ErrorMessage |
| Constructor and Description |
|---|
CanvasErrorResponse() |
| Modifier and Type | Method and Description |
|---|---|
Long |
getErrorReportId() |
List<CanvasErrorResponse.ErrorMessage> |
getErrors() |
String |
getStatus() |
void |
setErrorReportId(Long errorReportId) |
void |
setErrors(List<CanvasErrorResponse.ErrorMessage> errors) |
void |
setStatus(String status) |
public void setErrorReportId(Long errorReportId)
public Long getErrorReportId()
public void setStatus(String status)
public String getStatus()
public void setErrors(List<CanvasErrorResponse.ErrorMessage> errors)
public List<CanvasErrorResponse.ErrorMessage> getErrors()
Copyright © 2021 Kansas State University, Office of Mediated Education. All rights reserved.