Change error handling from throw to printf.