(&self, hook_type: HookType, input: &[u8])
| 131 | } |
| 132 | |
| 133 | fn parse_json(&self, hook_type: HookType, input: &[u8]) -> AgentResult<Value> { |
| 134 | if input.is_empty() { |
| 135 | return Err(AgentError::HookInputEmpty { |
| 136 | agent: self.name().to_string(), |
| 137 | hook_type: hook_type.as_str().to_string(), |
| 138 | }); |
| 139 | } |
| 140 | serde_json::from_slice(input).map_err(|e| AgentError::HookParseFailed { |
| 141 | agent: self.name().to_string(), |
| 142 | hook_type: hook_type.as_str().to_string(), |
| 143 | reason: e.to_string(), |
| 144 | }) |
| 145 | } |
| 146 | |
| 147 | fn parse_common(&self, hook_type: HookType, raw: Value) -> AgentResult<CommonInput> { |
| 148 | serde_json::from_value(raw).map_err(|e| AgentError::HookParseFailed { |
no test coverage detected