In some cases you want to transform the kind of an exception, and then holding the initial exception as interior exception is the greatest you can do. Although it should be throw new MyCustomException(myMessage, ex); obviously.Alternatively, You can utilize git stash or even more extensively git stash help save "name description" to save your code