(&self, hook_type: HookType, input: &[u8])
| 160 | } |
| 161 | |
| 162 | fn parse_json(&self, hook_type: HookType, input: &[u8]) -> AgentResult<Value> { |
| 163 | if input.is_empty() { |
| 164 | return Err(AgentError::HookInputEmpty { |
| 165 | agent: self.name().to_string(), |
| 166 | hook_type: hook_type.as_str().to_string(), |
| 167 | }); |
| 168 | } |
| 169 | serde_json::from_slice(input).map_err(|e| AgentError::HookParseFailed { |
| 170 | agent: self.name().to_string(), |
| 171 | hook_type: hook_type.as_str().to_string(), |
| 172 | reason: e.to_string(), |
| 173 | }) |
| 174 | } |
| 175 | |
| 176 | fn parse_common(&self, hook_type: HookType, raw: Value) -> AgentResult<CommonInput> { |
| 177 | serde_json::from_value(raw).map_err(|e| AgentError::HookParseFailed { |
no test coverage detected