Reverting "remove error function in proto"
Revert "remove error function in proto"

This reverts commit 4f91a9edb8e1546b3e087d9dabe902c8aa8fa7ed.