Repository navigation
Expand file tree
/
Copy pathTaskSerializationException.java
More file actions
87 lines (79 loc) · 2.65 KB
/
Copy pathTaskSerializationException.java
File metadata and controls
87 lines (79 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package io.a2a.server.tasks;
import org.jspecify.annotations.Nullable;
/**
* Exception for task serialization/deserialization failures.
* <p>
* Indicates failures converting between Task domain objects and persistent storage format (JSON).
*
* <h2>Common Scenarios</h2>
* <ul>
* <li>JSON parsing errors during {@code get()} operations</li>
* <li>JSON serialization errors during {@code save()} operations</li>
* <li>Invalid enum values or missing required fields</li>
* <li>Data format version mismatches after upgrades</li>
* </ul>
*
* <h2>Usage Example</h2>
* <pre>{@code
* try {
* Task task = jsonMapper.readValue(json, Task.class);
* } catch (JsonProcessingException e) {
* throw new TaskSerializationException(taskId, "Failed to deserialize task", e);
* }
* }</pre>
*
* @see TaskStoreException
* @see TaskPersistenceException for database failures
*/
public class TaskSerializationException extends TaskStoreException {
/**
* Creates a new TaskSerializationException with no message or cause.
*/
public TaskSerializationException() {
super();
}
/**
* Creates a new TaskSerializationException with the specified message.
*
* @param msg the exception message
*/
public TaskSerializationException(final String msg) {
super(msg);
}
/**
* Creates a new TaskSerializationException with the specified cause.
*
* @param cause the underlying cause
*/
public TaskSerializationException(final Throwable cause) {
super(cause);
}
/**
* Creates a new TaskSerializationException with the specified message and cause.
*
* @param msg the exception message
* @param cause the underlying cause
*/
public TaskSerializationException(final String msg, final Throwable cause) {
super(msg, cause);
}
/**
* Creates a new TaskSerializationException with the specified task ID and message.
*
* @param taskId the task identifier (may be null for operations not tied to a specific task)
* @param msg the exception message
*/
public TaskSerializationException(@Nullable final String taskId, final String msg) {
super(taskId, msg);
}
/**
* Creates a new TaskSerializationException with the specified task ID, message, and cause.
*
* @param taskId the task identifier (may be null for operations not tied to a specific task)
* @param msg the exception message
* @param cause the underlying cause
*/
public TaskSerializationException(@Nullable final String taskId, final String msg, final Throwable cause) {
super(taskId, msg, cause);
}
}