Keep build directory when exception occurs