Some code cleanup.

 * drop unused constructor from `error_type`.
 * error code is generated automatically in `error_type` constructor.