Move exceptions to separate file.

@tylertreat