Handling error in type-loader