We study the error detection problem in $ {{q}} {{x}_{{i}}} {{y}_{{i}}} {{y}_{{i}} \geq {x}_{{i}}} $ . A general setting is assumed, where the noise vectors are (potentially) restricted in: 1) the amplitude, $ {{y}_{{i}} - {x}_{{i }} \leq {a}} $ , 2) the Hamming weight, $ {\sum _{i=1}^{n} {\mathsf {1}}_{\{y_{i} \neq x_{i}\}} \leq h} $ , and 3) the total weight, $ {\sum _{i=1}^{n} (y_{i} - x_{i}) \leq t} {{{a, h, t}}} $ , both in the standard and in the cyclic ( $ {\mathrm {mod}\, q} $ ) version of the problem. It is also demonstrated that these codes are optimal in the large alphabet limit for every $ {{{a, h, t}}} {{n}} $ .