Console log replaced with exception