use try catch to catch any errors for preprocessed js

we can use the error to output to the console, closes #1354