Handle demux errors and translate to HTTP status code (fixes #13 and closes #2)