refactor: format error message properly