fix: should check .attr field existence.
fix: unnecessary condition statement has been removed.
change: type of enum error has changed to table.
change: type of struct error has changed to table.