Skip to content

Commit b84b4d1

Browse files
committed
comments for better readability
1 parent 7eea44d commit b84b4d1

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/kotlin/com/nylas/models/NylasApiError.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ data class NylasApiError(
4141
override var headers: Map<String, List<String>>? = null,
4242
) : AbstractNylasApiError(message, statusCode, requestId, headers) {
4343

44+
/**
45+
* Formats the error as a human-readable string.
46+
*
47+
* Example output:
48+
* ```
49+
* NylasApiError: Bad Request (HTTP 400)
50+
* Validation errors:
51+
* - when.end_time: must be after start_time
52+
* Request ID: abc-123
53+
* ```
54+
*/
4455
override fun toString(): String {
4556
val sb = StringBuilder()
4657
sb.append("NylasApiError: $message")

src/main/kotlin/com/nylas/models/UpdateEventRequest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ data class UpdateEventRequest(
281281
*/
282282
fun build(): Timespan {
283283
// Validate that if both times are set, endTime must be after startTime
284+
// Local variables for smart-cast null safety
284285
val start = startTime
285286
val end = endTime
286287
if (start != null && end != null) {

0 commit comments

Comments
 (0)