move exceptions to scala