(status: Status)
| 1821 | } |
| 1822 | |
| 1823 | fn compute_error_from_status(status: Status) -> ComputeError { |
| 1824 | match status.code() { |
| 1825 | Code::AlreadyExists => ComputeError::AlreadyExists, |
| 1826 | Code::FailedPrecondition => ComputeError::Precondition(status.message().to_string()), |
| 1827 | _ => ComputeError::Message(status.message().to_string()), |
| 1828 | } |
| 1829 | } |
| 1830 | |
| 1831 | fn decode_sandbox_record(record: &ObjectRecord) -> Result<Sandbox, String> { |
| 1832 | Sandbox::decode(record.payload.as_slice()).map_err(|e| e.to_string()) |