Handle an illegal value by returning an error, Coverity #1233093 is
worried the default switch case will leak allocated memory.