Skip to content

Commit 90eebbb

Browse files
committed
Fix clang-format lint and remove duplicate error code from message
ErrorHelper.formatMessage already prefixes the error code, so including it in the details string was redundant. This commit was authored with the help of Claude.
1 parent 3b416fc commit 90eebbb

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

extension/android/jni/jni_layer_llama.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -598,19 +598,16 @@ class ExecuTorchLlmJni : public facebook::jni::HybridClass<ExecuTorchLlmJni> {
598598
std::stringstream ss;
599599
ss << "Model runner was not created. model_type_category="
600600
<< model_type_category_
601-
<< ". Valid values: " << MODEL_TYPE_CATEGORY_LLM
602-
<< " (LLM), " << MODEL_TYPE_CATEGORY_MULTIMODAL << " (Multimodal)";
601+
<< ". Valid values: " << MODEL_TYPE_CATEGORY_LLM << " (LLM), "
602+
<< MODEL_TYPE_CATEGORY_MULTIMODAL << " (Multimodal)";
603603
executorch::jni_helper::throwExecutorchException(
604604
static_cast<uint32_t>(Error::InvalidState), ss.str().c_str());
605605
return static_cast<jint>(Error::InvalidState);
606606
}
607607
const auto load_result = static_cast<jint>(runner_->load());
608608
if (load_result != static_cast<jint>(Error::Ok)) {
609-
std::stringstream ss;
610-
ss << "Failed to load model runner [error code: 0x"
611-
<< std::hex << load_result << "]";
612609
executorch::jni_helper::throwExecutorchException(
613-
static_cast<uint32_t>(load_result), ss.str().c_str());
610+
static_cast<uint32_t>(load_result), "Failed to load model runner");
614611
}
615612
return load_result;
616613
}

0 commit comments

Comments
 (0)