adds many try..catch blocks to handle custom exceptions