Return proper error codes from the SMS service

Small refactoring to quiet pylint.