Skip to content

[Feature Request]: Add Null Checks and Improve Error Handling in Frontend Form Handlers (admin.js) #668

@rakdutta

Description

@rakdutta

📌 Description
Update the admin.js frontend file to add proper null/undefined checks and enhance error handling across all form handlers to improve robustness and user feedback.

🛠️ Proposed Changes
Add null checks for result.message using optional chaining and default error messages.

Refactor all relevant form handlers to throw meaningful errors.

Affected File(s)
mcpgateway/frontend/admin.js

Justification
Prevents runtime errors in case of unexpected null/undefined values.

Provides fallback messages to help debug frontend errors.

Improves user experience with more meaningful error reporting.

🧪 Acceptance Criteria
All form handlers in admin.js implement consistent null checks.

Error messages fall back to default when result.message is missing.

No regression or breaking changes introduced in the form submission flow.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttriageIssues / Features awaiting triage

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions