Like @mamoonraja did, I've experienced the 502 Bad gateway error frequently on https://visual-recognition-code-pattern.ng.bluemix.net/ when I uploaded images. However, it works fine when I choose the example image packaged in application code!
So, I doubted if this is happening when there was a problem creating the image file in the Cloud Foundry runtime. After I review the code i knew that there is no error handler for creating temporary files and it does not remove temporary files after use.
In this PR, I added the error handler and the code to remove the temporary file.
Like @mamoonraja did, I've experienced the
502 Bad gateway
error frequently on https://visual-recognition-code-pattern.ng.bluemix.net/ when I uploaded images. However, it works fine when I choose the example image packaged in application code!So, I doubted if this is happening when there was a problem creating the image file in the Cloud Foundry runtime. After I review the code i knew that there is no error handler for creating temporary files and it does not remove temporary files after use.
In this PR, I added the error handler and the code to remove the temporary file.
Thanks.