In this work, we delve into the typical errors that frequently arise in communication and storage systems, including deletion, insertion, substitution, and adjacent transposition errors. To effectively address these errors, a novel q-ary code construction (q ≥ 2) which consists of three constraints is proposed. Significantly, the devised codes mark the initial venture into q-ary code design, exhibiting 2 log q n + 4 redundancy symbols in rectifying a single deletion, insertion, substitution, or adjacent transposition error. This work also provides a meticulous mathematical analysis of the design of the proposed code, especially how our proposed code can distinguish the substitution and adjacent transposition error scenarios. In addition, a comprehensive decoding procedure for all error scenarios is also proposed.