Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display better error if Canvas Studio video cannot be used with Via #6233

Merged
merged 1 commit into from
May 7, 2024

Conversation

robertknight
Copy link
Member

@robertknight robertknight commented Apr 30, 2024

Display a more helpful error in the case where a download URL cannot be obtained for a Canvas Studio video because it is hosted in YouTube or Vimeo. At the same time, also improve the presentation of the error when the video doesn't have a transcript.

The errors look like this:

Canvas Studio video fetch error Canvas Studio no transcript error

Fixes #6231

[1] See https://hypothes-is.slack.com/archives/C1MA4E9B9/p1714472977336609

@robertknight robertknight force-pushed the canvas-studio-handle-external-videos branch 3 times, most recently from 1066246 to d5b59fb Compare April 30, 2024 11:45
@robertknight robertknight requested review from marcospri and removed request for marcospri April 30, 2024 11:50
@robertknight robertknight force-pushed the canvas-studio-handle-external-videos branch 2 times, most recently from 5435dc4 to 781ad75 Compare April 30, 2024 12:59
Display a more helpful error in the case where a download URL cannot be obtained
for a Canvas Studio video because it is hosted in YouTube or Vimeo.
@robertknight robertknight force-pushed the canvas-studio-handle-external-videos branch from 781ad75 to ba00bc0 Compare April 30, 2024 13:07
hosted on YouTube or Vimeo cannot be used.
</p>
</ErrorModal>
);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something slightly confusing about these error messages is the fact that what you see here is not the entire message. Instead the server-provided message is shown at the top, and the children of the ErrorModal are shown underneath.

For some of these errors, the server-side response includes only a code, for others there is a code and a message. Here I followed the pattern of those errors which include a short summary in the response, and then include extra details as ErrorModal children.

If we want to translate these error messages in future, then we'll need to have them all in one place though.

raise HTTPBadRequest("Unable to get Canvas Studio media ID")
raise CanvasStudioLaunchError(
"canvas_studio_media_not_found", "Unable to get Canvas Studio media ID"
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This particular error should never happen unless the document URL got edited on Canvas's side or we screwed up when generating it. However there is another related error which could happen, which is if the video gets removed in Canvas. I've used an error code which reflects that more general case.

@robertknight robertknight marked this pull request as ready for review April 30, 2024 13:22
@robertknight robertknight requested a review from marcospri May 2, 2024 10:28
@robertknight robertknight merged commit c7d7d9a into main May 7, 2024
8 checks passed
@robertknight robertknight deleted the canvas-studio-handle-external-videos branch May 7, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing error if user tries to use a YouTube or Vimeo video with the Canvas Studio integration
2 participants