invoked by s3_export(), need to be exception safe
| 130 | |
| 131 | // invoked by s3_export(), need to be exception safe |
| 132 | bool writer_cleanup(GPWriter** writer) { |
| 133 | bool result = true; |
| 134 | try { |
| 135 | if (*writer) { |
| 136 | (*writer)->close(); |
| 137 | delete *writer; |
| 138 | *writer = NULL; |
| 139 | } else { |
| 140 | result = false; |
| 141 | } |
| 142 | } catch (S3Exception& e) { |
| 143 | s3extErrorMessage = |
| 144 | "writer_cleanup caught a " + e.getType() + " exception: " + e.getFullMessage(); |
| 145 | S3ERROR("writer_cleanup caught %s: %s", e.getType().c_str(), s3extErrorMessage.c_str()); |
| 146 | result = false; |
| 147 | } catch (...) { |
| 148 | S3ERROR("Caught an unexpected exception."); |
| 149 | s3extErrorMessage = "Caught an unexpected exception."; |
| 150 | result = false; |
| 151 | } |
| 152 | |
| 153 | return result; |
| 154 | } |
no test coverage detected