in src/main/java/com/amazonaws/kinesisvideo/internal/service/DefaultServiceCallbacksImpl.java [665:685]
protected static int getStatusCodeFromException(@Nullable final Throwable e) {
// TODO: Implement this properly
if (e == null) {
return HTTP_OK;
} else if (e.getClass().getName().endsWith(RESOURCE_NOT_FOUND)) {
return HTTP_NOT_FOUND;
} else if (e.getClass().getName().endsWith(RESOURCE_IN_USE)) {
return HTTP_RESOURCE_IN_USE;
} else if (e.getClass().getName().endsWith(ACCESS_DENIED)) {
return HTTP_ACCESS_DENIED;
} else {
// Try to analyze the cause
final Throwable cause = e.getCause();
if (cause != null) {
return getStatusCodeFromException(cause);
} else {
// Default to bad request
return HTTP_BAD_REQUEST;
}
}
}