Fix the raise exception issue

TypeError: exceptions must be old-style classes or derived from BaseException, not str