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

Make errors stack traces of createPacketBuffer readable #155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zardoy
Copy link

@zardoy zardoy commented Apr 28, 2024

Some error reporting tools like Sentry already do increase stack trace limit, but I think it would be good to make this default behavior. example stack trace with the extended limit:

at module.exports.Write.UUID ([email protected]\node_modules\minecraft-protocol\src\datatypes\compiler-minecraft.js:48:25)    
    at eval (eval at compile ([email protected]\node_modules\protodef\src\compiler.js:258:12), <anonymous>:1909:30)
    at eval (eval at compile ([email protected]\node_modules\protodef\src\compiler.js:258:12), <anonymous>:2395:11)
    at Object.packet_player_info (eval at compile ([email protected]\node_modules\protodef\src\compiler.js:258:12), <anonymous>:2398:9)     
    at eval (eval at compile ([email protected]\node_modules\protodef\src\compiler.js:258:12), <anonymous>:3375:62)
    at packet (eval at compile ([email protected]\node_modules\protodef\src\compiler.js:258:12), <anonymous>:3430:9)
    at CompiledProtodef.write ([email protected]\node_modules\protodef\src\compiler.js:76:12)
    at [email protected]\node_modules\protodef\src\compiler.js:102:25
    at tryCatch ([email protected]\node_modules\protodef\src\utils.js:51:16)
    at CompiledProtodef.createPacketBuffer ([email protected]\node_modules\protodef\src\compiler.js:102:5)
    at Serializer.createPacketBuffer ([email protected]\node_modules\protodef\src\serializer.js:12:23)
    at Serializer._transform ([email protected]\node_modules\protodef\src\serializer.js:18:18)
    at Transform._read ([email protected]\node_modules\readable-stream\lib\_stream_transform.js:166:10)
    at Transform._write ([email protected]\node_modules\readable-stream\lib\_stream_transform.js:155:83)
    at doWrite ([email protected]\node_modules\readable-stream\lib\_stream_writable.js:390:139)
    at writeOrBuffer ([email protected]\node_modules\readable-stream\lib\_stream_writable.js:381:5)
    at Writable.write ([email protected]\node_modules\readable-stream\lib\_stream_writable.js:302:11)
    at Client.write ([email protected]\node_modules\minecraft-protocol\src\client.js:241:21)
(18)at sendLoginPacket (main.ts:200:20)

If you don't like the idea of increasing the stack trace consider at least adding the packet to the message that caused the problem

@rom1504
Copy link
Member

rom1504 commented Jun 9, 2024

Please provide some examples of errors with the new code

The TryCatch part applies to lot of places

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants