question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

If I use scanPath or scanBytes to scan an image, and the image doesn’t have a barcode, the code keeps waiting instead of returning null or throwing an exception or anything like it.

For example:

String path = '/path/to/my/image.jpg';
print('scanning barcode...');
String barcode = await scanner.scanPath(path);
print('done');

Will print “done” only if the image has a barcode. If not, “done” will never get executed and the code will keep on waiting to scanner.scanPath to finish. No exceptions are thrown.

  • Tested on an Android device

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
lucaslannescommented, Jan 21, 2021

Folks, i made a pull request to allow catching this error. Check this out #92 😃

1reaction
HTMHellcommented, Dec 14, 2020

I got the same problem, you figured it out?

Not really. As a workaround you can set timeout for the future method:

String barcode = await scanner
        .scanPath(path)
        .timeout(Duration(seconds: 2));

and you should catch the timeout exception, or pass onTimeout argument to timeout method.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Defender scan never finishes windows 10s mode
I have never been able to run a defender scan. When I click quick scan, it shows dots like it is scanning but...
Read more >
What to do when a Tenable.io Web Application Scanning scan ...
What to do when a Tenable.io Web Application Scanning scan never finishes or times out. Tenable recommends that you first run high-level overview...
Read more >
Scan never finishes - Malwarebytes for Windows Support Forum
My Malwarebytes won't stop scanning after reaching the "Scanning File System" stage. It's gone as long as 70 hours once before I had...
Read more >
Windows 10: quick scan never completes
When I try to employ a "Quick Scan" procedure in Defender, the scan progress indicator, coloured green, stops half way and does not...
Read more >
Bitdefender Scan Never Finishes.
Bitdefender Scan Never Finishes. ... The scan can end after the infected files are moved to quarantine, deleted or ignored.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found