2.25 sync: added error class, session flags and use []byte as argument instead of string