| 29 | } |
| 30 | |
| 31 | void HTTPWriter::close(const Exception& ex) { |
| 32 | int code(500); |
| 33 | switch(ex.code()) { |
| 34 | case Exception::FILE: |
| 35 | code = 404; |
| 36 | break; |
| 37 | case Exception::PERMISSION: |
| 38 | code = 403; |
| 39 | break; |
| 40 | case Exception::APPLICATION: |
| 41 | code = 503; |
| 42 | break; |
| 43 | default: break; |
| 44 | } |
| 45 | _lastError.assign(ex.error()); |
| 46 | close(code); |
| 47 | } |
| 48 | |
| 49 | void HTTPWriter::close(Int32 code) { |
| 50 | if (code < 0) |
no test coverage detected