(e: anyhow::Error)
| 189 | } |
| 190 | |
| 191 | fn err_to_result_code(e: anyhow::Error) -> backend::ResultCode { |
| 192 | if let Some(e) = e.downcast_ref::<StorageError>() { |
| 193 | return match e { |
| 194 | StorageError::NotFound(_) => backend::ResultCode::UnknownDevAddr, |
| 195 | StorageError::InvalidMIC | StorageError::InvalidDevNonce => { |
| 196 | backend::ResultCode::MICFailed |
| 197 | } |
| 198 | _ => backend::ResultCode::Other, |
| 199 | }; |
| 200 | } |
| 201 | if let Some(e) = e.downcast_ref::<UplinkError>() { |
| 202 | return match e { |
| 203 | UplinkError::RoamingIsNotAllowed => backend::ResultCode::DevRoamingDisallowed, |
| 204 | _ => backend::ResultCode::Other, |
| 205 | }; |
| 206 | } |
| 207 | backend::ResultCode::Other |
| 208 | } |
| 209 | |
| 210 | async fn handle_pr_start_req( |
| 211 | sender_client: Arc<backend::Client>, |
no outgoing calls
no test coverage detected