sgidec: return meaningful error codes