mirror of
https://github.com/b3nw/nginx-proxy-manager-mcp.git
synced 2026-06-15 00:59:40 -05:00
5e89176806
Reads nginx access/error logs directly from a mounted NPM log directory, enabling agents to debug proxy issues without SSH access. Requires mounting NPM's /data/logs volume and setting NPM_LOG_DIR. Also includes a feature request PRD for proposing a native log API upstream.
40 lines
756 B
Python
40 lines
756 B
Python
"""Custom exceptions for NPM API client."""
|
|
|
|
|
|
class NpmClientError(Exception):
|
|
"""Base exception for NPM client errors."""
|
|
|
|
pass
|
|
|
|
|
|
class NpmAuthenticationError(NpmClientError):
|
|
"""Raised when authentication fails."""
|
|
|
|
pass
|
|
|
|
|
|
class NpmConnectionError(NpmClientError):
|
|
"""Raised when connection to NPM fails."""
|
|
|
|
pass
|
|
|
|
|
|
class NpmNotFoundError(NpmClientError):
|
|
"""Raised when a resource is not found."""
|
|
|
|
pass
|
|
|
|
|
|
class NpmApiError(NpmClientError):
|
|
"""Raised for general API errors."""
|
|
|
|
def __init__(self, message: str, status_code: int | None = None):
|
|
super().__init__(message)
|
|
self.status_code = status_code
|
|
|
|
|
|
class NpmLogError(NpmClientError):
|
|
"""Raised when log file operations fail."""
|
|
|
|
pass
|