Improve error message for invalid thread ID
Include the actual invalid value in error message for better debugging Co-authored-by: zhaopengme <1415418+zhaopengme@users.noreply.github.com>
This commit is contained in:
parent
fb2179d1b5
commit
e088cbafa6
1 changed files with 1 additions and 1 deletions
|
|
@ -433,7 +433,7 @@ func parseTelegramChatID(chatIDStr string) (chatID int64, threadID int, err erro
|
||||||
var tid int
|
var tid int
|
||||||
_, err = fmt.Sscanf(parts[1], "%d", &tid)
|
_, err = fmt.Sscanf(parts[1], "%d", &tid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return chatID, 0, fmt.Errorf("invalid thread ID: %w", err)
|
return chatID, 0, fmt.Errorf("invalid thread ID '%s': %w", parts[1], err)
|
||||||
}
|
}
|
||||||
threadID = tid
|
threadID = tid
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue