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

Issues with Throw errors #76

Open
tagyoureit opened this issue Jan 10, 2018 · 3 comments
Open

Issues with Throw errors #76

tagyoureit opened this issue Jan 10, 2018 · 3 comments

Comments

@tagyoureit
Copy link

Hi,
I've run into a couple of situations where your module Throws an error, but there is no way to catch it in my application. For example,

uncaught exception! Error: type voucher_com_udemy_tv-auth has more than 20 characters
    at checkFormat (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/service_type.js:244:11)
    at fromString (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/service_type.js:118:5)
    at new exports.ServiceType (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/service_type.js:31:14)
    at /Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/decoder.js:40:27
    at /Users/machine_name/Documents/programming/nodejs-poolController/node_modules/dns-js/lib/dnspacket.js:223:7
    at Array.forEach (native)
    at each (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/dns-js/lib/dnspacket.js:221:17)
    at module.exports.decodeSection (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/decoder.js:26:10)
    at /Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/decoder.js:111:5
    at Array.forEach (native)
    at Object.module.exports.decodePackets (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/decoder.js:99:11)
    at Browser.onMessage (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/browser.js:47:26)
    at emitThree (events.js:116:13)
    at emit (events.js:194:7)
    at Socket.<anonymous> (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/networking.js:144:10)
    at emitTwo (events.js:106:13)

and

uncaught exception! TypeError: Cannot read property 'length' of undefined
    at checkFormat (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/service_type.js:240:10)
    at fromString (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/service_type.js:118:5)
    at new exports.ServiceType (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/service_type.js:31:14)
    at /Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/decoder.js:40:27
    at /Users/machine_name/Documents/programming/nodejs-poolController/node_modules/dns-js/lib/dnspacket.js:223:7
    at Array.forEach (native)
    at each (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/dns-js/lib/dnspacket.js:221:17)
    at module.exports.decodeSection (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/decoder.js:26:10)
    at /Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/decoder.js:111:5
    at Array.forEach (native)
    at Object.module.exports.decodePackets (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/decoder.js:99:11)
    at Browser.onMessage (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/browser.js:47:26)
    at emitThree (events.js:116:13)
    at emit (events.js:194:7)
    at Socket.<anonymous> (/Users/machine_name/Documents/programming/nodejs-poolController/node_modules/mdns-js/lib/networking.js:144:10)
    at emitTwo (events.js:106:13)

It would be great if these errors (and all errors) were emitted to a browser.on('error', function...) event. It would be hard to officially include this module in my code when it causes an error to exit the nodejs process.

thanks!

@blamay
Copy link

blamay commented Feb 2, 2021

I fixed these two errors but I wasn't able to push because this repo is giving me a 403. I also can't officially use this module because of guaranteed error messages every time a service has a length longer than 20.

@kmpm
Copy link
Collaborator

kmpm commented Feb 2, 2021

If I understand correctly, you have made some changes to this modules code but havent been able to create a pull request because of 403?

@blamay
Copy link

blamay commented Feb 4, 2021

Correct, I've tried with SSH & HTTPS. Maybe I don't have permission to push? I didn't add error emitting or anything, I just removed MAX_STRING from service_type.js along with its references, because I don't see how checking it adds any value, especially when the Error can't be caught.

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

No branches or pull requests

3 participants