diff --git a/src/cas.rs b/src/cas.rs
index 4ffe908bb2b89a95b0554970e509ef9f0dc732bf..2ee14179792b7bb4d40a56a1a31c56e06532a15e 100644
--- a/src/cas.rs
+++ b/src/cas.rs
@@ -288,43 +288,47 @@ crate::define_rpc_request! {
 /// Usually it can't be handled and should be either retried from
 /// scratch or returned to a user as is.
 ///
+// NOTE: these error messages are relied on in luamod.lua,
+// don't forget to update them everywhere if you're changing them.
 #[derive(Debug, ::thiserror::Error)]
 pub enum Error {
     /// Can't check the predicate because raft log is compacted.
-    #[error("raft index {requested} is compacted at {compacted_index}")]
+    #[error("Compacted: raft index {requested} is compacted at {compacted_index}")]
     Compacted {
         requested: RaftIndex,
         compacted_index: RaftIndex,
     },
 
     /// Nearly impossible error indicating invalid request.
-    #[error("raft entry at index {requested} does not exist yet, the last is {last_index}")]
+    #[error(
+        "NoSuchIndex: raft entry at index {requested} does not exist yet, the last is {last_index}"
+    )]
     NoSuchIndex {
         requested: RaftIndex,
         last_index: RaftIndex,
     },
 
     /// Checking the predicate revealed a collision.
-    #[error("comparison failed for index {requested} as it conflicts with {conflict_index}")]
+    #[error("ConflictFound: comparison failed for index {requested} as it conflicts with {conflict_index}")]
     ConflictFound {
         requested: RaftIndex,
         conflict_index: RaftIndex,
     },
 
     /// Checking the predicate revealed a collision.
-    #[error("entry at index {index} has term {actual_term}, request implies term {expected_term}")]
+    #[error("EntryTermMismatch: entry at index {index} has term {actual_term}, request implies term {expected_term}")]
     EntryTermMismatch {
         index: RaftIndex,
         expected_term: RaftTerm,
         actual_term: RaftTerm,
     },
 
-    #[error("space {space} is prohibited for use in a predicate")]
+    #[error("SpaceNotAllowed: space {space} is prohibited for use in a predicate")]
     SpaceNotAllowed { space: String },
 
     /// An error related to `key_def` operation arised from tarantool
     /// depths while checking the predicate.
-    #[error("failed comparing predicate ranges: {0}")]
+    #[error("KeyTypeMismatch: failed comparing predicate ranges: {0}")]
     KeyTypeMismatch(#[from] TntError),
 }
 
diff --git a/src/traft/error.rs b/src/traft/error.rs
index 0ccfc5fb4feab3939590a56aa938d4a05d1e871e..7915c205d8b5557f9d5c252b0985c1b5b8dc3fd8 100644
--- a/src/traft/error.rs
+++ b/src/traft/error.rs
@@ -35,11 +35,15 @@ pub enum Error {
         instance_rsid: String,
         requested_rsid: String,
     },
+    // NOTE: this error message is relied on in luamod.lua,
+    // don't forget to update it everywhere if you're changing it.
     #[error("operation request from different term {requested}, current term is {current}")]
     TermMismatch {
         requested: RaftTerm,
         current: RaftTerm,
     },
+    // NOTE: this error message is relied on in luamod.lua,
+    // don't forget to update it everywhere if you're changing it.
     #[error("not a leader")]
     NotALeader,
     #[error("lua error: {0}")]
@@ -61,7 +65,7 @@ pub enum Error {
     #[error("governor has stopped")]
     GovernorStopped,
 
-    #[error("compare-and-swap request failed: {0}")]
+    #[error("compare-and-swap: {0}")]
     Cas(#[from] crate::cas::Error),
     #[error("ddl failed: {0}")]
     Ddl(#[from] crate::schema::DdlError),
@@ -86,7 +90,7 @@ impl Error {
 
     /// Temporary solution until proc_cas returns structured errors
     pub fn is_cas_err(&self) -> bool {
-        self.to_string().contains("compare-and-swap request failed")
+        self.to_string().contains("compare-and-swap")
     }
 
     /// Temporary solution until proc_cas returns structured errors
diff --git a/test/int/test_cas.py b/test/int/test_cas.py
index e4bfc8cb006d84e36d6a0c65f008d72468bf96dc..5e1198dd0adf5aedde7a52977aef09b35f16515d 100644
--- a/test/int/test_cas.py
+++ b/test/int/test_cas.py
@@ -52,7 +52,7 @@ def test_cas_errors(instance: Instance):
         )
     assert e3.value.args == (
         "ER_PROC_C",
-        "compare-and-swap request failed: entry at index 1 has term 1, request implies term 2",
+        "compare-and-swap: EntryTermMismatch: entry at index 1 has term 1, request implies term 2",
     )
 
     # Wrong index (too big)
@@ -65,7 +65,7 @@ def test_cas_errors(instance: Instance):
         )
     assert e4.value.args == (
         "ER_PROC_C",
-        "compare-and-swap request failed: "
+        "compare-and-swap: NoSuchIndex: "
         + f"raft entry at index 2048 does not exist yet, the last is {index}",
     )
 
@@ -77,7 +77,7 @@ def test_cas_errors(instance: Instance):
         instance.cas("insert", "_pico_property", ["foo", "420"], index=index - 1)
     assert e5.value.args == (
         "ER_PROC_C",
-        "compare-and-swap request failed: "
+        "compare-and-swap: Compacted: "
         + f"raft index {index-1} is compacted at {index}",
     )
 
@@ -92,7 +92,7 @@ def test_cas_errors(instance: Instance):
             )
         assert e5.value.args == (
             "ER_PROC_C",
-            f"compare-and-swap request failed: space {space} is prohibited for use "
+            f"compare-and-swap: SpaceNotAllowed: space {space} is prohibited for use "
             + "in a predicate",
         )
 
@@ -128,7 +128,7 @@ def test_cas_predicate(instance: Instance):
         )
     assert e5.value.args == (
         "ER_PROC_C",
-        "compare-and-swap request failed: "
+        "compare-and-swap: ConflictFound: "
         + f"comparison failed for index {read_index} "
         + f"as it conflicts with {read_index+1}",
     )
@@ -194,7 +194,7 @@ def test_cas_lua_api(cluster: Cluster):
             ranges=[CasRange(eq="fruit")],
         )
     assert e5.value.args == (
-        "compare-and-swap request failed: "
+        "compare-and-swap: ConflictFound: "
         + f"comparison failed for index {read_index} "
         + f"as it conflicts with {read_index+1}",
     )