Return 500 response in case of error on pdf download
+ Correction of an indentation error