Check if text contains Claude CLI authentication error messages. Uses case-insensitive pattern matching against known error messages. Args: text: Output text to check Returns: True if any auth error pattern matches, False otherwise
(text: str)
| 25 | |
| 26 | |
| 27 | def is_auth_error(text: str) -> bool: |
| 28 | """ |
| 29 | Check if text contains Claude CLI authentication error messages. |
| 30 | |
| 31 | Uses case-insensitive pattern matching against known error messages. |
| 32 | |
| 33 | Args: |
| 34 | text: Output text to check |
| 35 | |
| 36 | Returns: |
| 37 | True if any auth error pattern matches, False otherwise |
| 38 | """ |
| 39 | if not text: |
| 40 | return False |
| 41 | text_lower = text.lower() |
| 42 | for pattern in AUTH_ERROR_PATTERNS: |
| 43 | if re.search(pattern, text_lower): |
| 44 | return True |
| 45 | return False |
| 46 | |
| 47 | |
| 48 | # CLI-style help message (for terminal output) |
no outgoing calls
no test coverage detected