Add message formatting in exception