switch error object whether it is as SyntanxError.