(config_store: &Db, plugin_id: u64)
| 49 | } |
| 50 | |
| 51 | pub async fn fetch_plugin(config_store: &Db, plugin_id: u64) -> ApiResult<Plugin> { |
| 52 | config_store.get_plugin(plugin_id).await.map_err(|err| { |
| 53 | if matches!(err, ConfigStoreError::PluginNotFound(_)) { |
| 54 | ApiErrorResponse::PluginNotFound |
| 55 | } else { |
| 56 | error!(?err, "failed fetching plugin"); |
| 57 | ApiErrorResponse::InternalError |
| 58 | } |
| 59 | }) |
| 60 | } |
no test coverage detected