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

Errors in forks break non HTML pages #424

Open
hroncok opened this Issue Jul 1, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@hroncok
Member

hroncok commented Jul 1, 2018

When there is an error on a non-HTML page (such as ics), there is a HTML page rendered. That breaks FrozenFlask (expecting text/calendar by the filename, gets text/html).

nauce_error

No idea how we are supposed to handle this, but the current implementation breaks the entire build if this happens.

See #423 (comment) for context.

@hroncok hroncok added bug code labels Jul 1, 2018

@hroncok hroncok changed the title from Errors in forks brek non HTML pages to Errors in forks break non HTML pages Jul 1, 2018

@hroncok

This comment has been minimized.

Member

hroncok commented Jul 1, 2018

For the calendar particularly this is being handled in

logger.error("There was an error rendering url %s for course '%s'", request.path, course.slug)
logger.exception(e)
return render_template(
"error_in_fork.html",
malfunctioning_course=course,
edit_info=get_edit_info(course.edit_path),
faulty_page="calendar",
root_slug=model.meta.slug,
travis_build_id=os.environ.get("TRAVIS_BUILD_ID"),
)

We need to return something that has correct content type.

@encukou

This comment has been minimized.

Member

encukou commented Jul 1, 2018

It's actually in the .ics route.

logger.error("There was an error rendering url %s for course '%s'", request.path, course.slug)
logger.exception(e)
return render_template(
"error_in_fork.html",
malfunctioning_course=course,
edit_info=get_edit_info(course.edit_path),
faulty_page="calendar",
root_slug=model.meta.slug,
travis_build_id=os.environ.get("TRAVIS_BUILD_ID"),
)

To handle this in a static site we'd need an iCal error page. I don't think that's possible :(

@hroncok

This comment has been minimized.

Member

hroncok commented Jul 1, 2018

Right. Well, we can set the content type as a dirty workaround. The static site will then download an ics file with HTML content which isn't great, but at least it would build. Later, we can change the error to plaintext maybe.

@hroncok

This comment has been minimized.

Member

hroncok commented Jul 1, 2018

There's a power outage, so I'm on battery and cell data, so don't expect an actual fix/workaround from me any time soon (as it involves pulling docker images etc.).

@encukou

This comment has been minimized.

Member

encukou commented Jul 1, 2018

ACK, I'll do the workaround.

encukou added a commit to encukou/naucse.python.cz that referenced this issue Jul 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment