Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-message! message-reference's error mismatch #131

Open
Lezyes opened this issue Dec 5, 2023 · 0 comments
Open

create-message! message-reference's error mismatch #131

Lezyes opened this issue Dec 5, 2023 · 0 comments
Labels
bug report Reported, but unconfirmed bugs.

Comments

@Lezyes
Copy link

Lezyes commented Dec 5, 2023

Describe the bug
create-message!'s message-reference expects the key :message_id while the error for using the key :message-id says that :message-id is missing, leaving the user guessing what's wrong with their code.

#error {
 :cause Attempted to send an invalid message payload
 :data {:message Invalid Form Body, :code 50035, :errors {:message-reference {:message-id {:-errors [{:code BASE_TYPE_REQUIRED, :message This field is required}]}}}}

Version Information

  • Clojure Version: 1.11.1
  • Discljord Version:1.3.1
  • OS bot is hosted on: arch linux / clojure:temurin-21-lein docker

To Reproduce
Steps to reproduce the behavior:

  1. to get the error (discljord.messaging/create-message! conn channel-id :message-reference {:message-id message-id} :content "test")
  2. to get it working (discljord.messaging/create-message! conn channel-id :message-reference {:message_id message-id} :content "test")

Expected behavior
Either the key needed needs to be :message-id like the error states, or the error should state the key missing is :message_id.
(personally, I think the first is the right way, given almost everything is clojurized anyway...)

Logs

#error {
 :cause Attempted to send an invalid message payload
 :data {:message Invalid Form Body, :code 50035, :errors {:message-reference {:message-id {:-errors [{:code BASE_TYPE_REQUIRED, :message This field is required}]}}}}
 :via
 [{:type clojure.lang.ExceptionInfo
   :message Attempted to send an invalid message payload
   :data {:message Invalid Form Body, :code 50035, :errors {:message-reference {:message-id {:-errors [{:code BASE_TYPE_REQUIRED, :message This field is required}]}}}}
   :at [discljord.messaging.impl$send_message_BANG_ invokeStatic impl.clj 169]}]
 :trace
 [[discljord.messaging.impl$send_message_BANG_ invokeStatic impl.clj 169]
  [discljord.messaging.impl$send_message_BANG_ invoke impl.clj 152]
  [discljord.messaging.impl$eval11096$fn__11098 invoke impl.clj 187]
  [clojure.lang.MultiFn invoke MultiFn.java 239]
  [discljord.messaging.impl$make_request_BANG_$make_request__14028 invoke impl.clj 1140]
  [discljord.messaging.impl$make_request_BANG_ invokeStatic impl.clj 1145]
  [discljord.messaging.impl$make_request_BANG_ invoke impl.clj 1119]
  [discljord.messaging.impl$step_agent$fn__14052 invoke impl.clj 1190]
  [clojure.core$binding_conveyor_fn$fn__5823 invoke core.clj 2050]
  [clojure.lang.AFn applyToHelper AFn.java 154]
  [clojure.lang.RestFn applyTo RestFn.java 132]
  [clojure.lang.Agent$Action doRun Agent.java 114]
  [clojure.lang.Agent$Action run Agent.java 163]
  [java.util.concurrent.ThreadPoolExecutor runWorker ThreadPoolExecutor.java 1144]
  [java.util.concurrent.ThreadPoolExecutor$Worker run ThreadPoolExecutor.java 642]
  [java.lang.Thread run Thread.java 1583]]}
@Lezyes Lezyes added the bug report Reported, but unconfirmed bugs. label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Reported, but unconfirmed bugs.
Projects
None yet
Development

No branches or pull requests

1 participant