Publisher returns error message instead of code