Switch throw to use new Error()