catch js exceptions and wrap in Haskell exception for safe and interruptible imports