Modify the exception architecture.

Change the exception design in the project, including a root exception defining a set of causes.

Reviewers: @YantaoYao  @absaxena @behdad84 @yf6.