Skip to content

Commit 2ea0494

Browse files
author
Your Name
committed
Fixes #1112
1 parent 99cfb9f commit 2ea0494

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Architecture Decision Records (ADRs)
2+
3+
This directory contains Architecture Decision Records (ADRs) documenting key architectural decisions made in this project.
4+
5+
## Index of ADRs (To be updated when an ADR is added, modified, or updated)
6+
7+
- [Uniform Error Handling](uniform-error-handling.md)
8+
**Status**: Proposed | **Date**: 2024-12-12
9+
**Related Links**: [Issue #1112](#)
10+
11+
## Maintenance Guidelines
12+
13+
1. Keep Index Updated: Always update the index above when a new ADR is added or its status changes.
14+
2. Use Consistent Formatting: Follow the provided template to ensure clarity and uniformity.
15+
3. Cross-Reference Decisions: Link to related Issues, PRs, or other ADRs for better traceability.
16+
17+
## Format for New ADRs
18+
19+
To add a new ADR to this directory:
20+
21+
1. Create a new markdown file in this directory with a descriptive filename (e.g., `use-graphql.md`).
22+
2. Use the following template for the ADR content:
23+
24+
```markdown
25+
# [Title of the Decision]
26+
27+
## Status
28+
[Proposed | Accepted | Deprecated | Rejected]
29+
30+
## Context
31+
[Explain why this decision is being made. Provide background information, such as the problem to be solved, goals, and relevant constraints.]
32+
33+
## Decision
34+
[Clearly describe the decision made. Include details about what was chosen and how it will be implemented.]
35+
36+
## Consequences
37+
### Positive
38+
[Describe the benefits of the decision.]
39+
40+
### Negative
41+
[Describe the trade-offs, risks, or potential issues resulting from this decision.]
42+
43+
## Alternatives Considered
44+
1. [Alternative 1]: [Brief description of the alternative, its pros, and cons.]
45+
2. [Alternative 2]: [Brief description of the alternative, its pros, and cons.]
46+
47+
## References
48+
[Provide links to relevant documents, discussions, RFCs, PRs, Issues or resources that support this decision.]
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Uniform Error Handling
2+
3+
## Status
4+
Proposed
5+
6+
## Context
7+
The current error handling system logs errors only in the terminal, which are neither preserved nor useful for developers or users. This approach fails to inform users of encountered issues and does not support debugging by developers. A consistent and efficient error-handling strategy is required to enhance user experience and simplify debugging.
8+
9+
## Decision
10+
The **Error Dashboard** approach is proposed to be adopted as the method for handling system errors. This decision aligns with the need to consolidate real-time and asynchronous errors in a centralized location for better tracking and resolution.
11+
12+
### Why This Decision Was Taken
13+
Since there are tasks that run asynchronously (e.g., Celery tasks), errors from these operations cannot be shown to the user in real-time. To ensure that both real-time and asynchronous errors are recorded and displayed, this approach was chosen.
14+
15+
- **Real-Time Errors**: These will be updated in the notification dashboard immediately as they occur.
16+
- **Asynchronous Errors**: Errors encountered during asynchronous tasks (e.g., Celery tasks) will be recorded and updated in the dashboard once the task completes.
17+
18+
To achieve this, a targeted script will be developed to monitor asynchronous tasks. Details of this script are outlined in the **Monitoring Asynchronous Tasks** section of this ADR.
19+
20+
## Consequences
21+
22+
### Positive
23+
- **Centralization**: All errors are consolidated in one place, reducing the chances of overlooked issues.
24+
- **Improved User Experience**: Users have a clear view of errors affecting their operations without relying on backend logs or email notifications.
25+
- **Scalability**: Suitable for large-scale operations involving asynchronous and real-time tasks.
26+
27+
### Negative
28+
- **Navigation Overhead**: Users must navigate to the dashboard, which could be less convenient than inline error notifications.
29+
- **Resource Requirements**: Developing and maintaining the dashboard requires additional frontend and backend resources.
30+
31+
## Alternatives Considered
32+
33+
### 1. **Logging System**
34+
- **Approach**: Use Python’s built-in logging library to save structured logs with details like timestamps and severity levels.
35+
- **Advantages**:
36+
- Preserves logs for debugging.
37+
- Differentiates critical and minor errors for better prioritization.
38+
- Efficient for monitoring asynchronous tasks.
39+
- **Disadvantage**:
40+
- Primarily benefits developers; does not directly improve user interaction.
41+
42+
### 2. **Frontend Notifications**
43+
- **Approach**: Display error messages directly on the frontend.
44+
- **Advantages**:
45+
- Enhances user interaction by providing immediate feedback.
46+
- **Disadvantages**:
47+
- Resource-intensive to implement.
48+
- Real-time feedback is challenging for asynchronous tasks.
49+
50+
### 3. **Email Notifications**
51+
- **Approach**: Send email alerts for critical failures.
52+
- **Advantages**:
53+
- Simple to implement.
54+
- Suitable for asynchronous task monitoring.
55+
- **Disadvantage**:
56+
- Users need to register their emails.
57+
- Requires users to check emails, reducing immediacy of feedback.
58+
59+
### 4. **Error Dashboard**
60+
- **Approach**: Display errors on a dedicated frontend dashboard.
61+
- **Advantages**:
62+
- Consolidates both real-time and asynchronous errors.
63+
- Provides a centralized location for error tracking.
64+
- **Disadvantages**:
65+
- Requires navigation away from the operational page to view errors.
66+
67+
## Monitoring Asynchronous Tasks
68+
A targeted script will be developed to monitor asynchronous tasks for errors during import operations:
69+
- **Trigger**: Activated at the start of an import operation.
70+
- **Duration**: Runs for 10 minutes, polling the Flower API every minute.
71+
- **Functionality**:
72+
- Detects failed tasks related to the import.
73+
- Notifies developers or users as appropriate.
74+
75+
## References
76+
- Issue: [#1112](#)

0 commit comments

Comments
 (0)