Skip to content

Lastools error handling#415

Merged
dokempf merged 6 commits into
mainfrom
lastools_error_handling
Nov 14, 2025
Merged

Lastools error handling#415
dokempf merged 6 commits into
mainfrom
lastools_error_handling

Conversation

@dokempf

@dokempf dokempf commented Nov 4, 2025

Copy link
Copy Markdown
Member

No description provided.

@dokempf dokempf force-pushed the lastools_error_handling branch from 58e39a7 to 2f29761 Compare November 4, 2025 10:08
@dokempf

dokempf commented Nov 4, 2025

Copy link
Copy Markdown
Member Author

The error is now:

ERROR: LAStools lasground_new (by info@rapidlasso.de) version 251013 (unlicensed)
E           ERROR: license failure. Use '-demo' to run in demo mode.

@han16nah How should we handle this? Should AFWizard switch into demo mode if no license was found?

@han16nah

han16nah commented Nov 4, 2025

Copy link
Copy Markdown
Collaborator

The error is now:

ERROR: LAStools lasground_new (by info@rapidlasso.de) version 251013 (unlicensed)
E           ERROR: license failure. Use '-demo' to run in demo mode.

@han16nah How should we handle this? Should AFWizard switch into demo mode if no license was found?

Okay, seems like Linux and Windows behave differently here (Windows seems to automatically switch to -demo) and proceeds the processing, at least the version I tested.

So yes, it should then switch in demo mode. Maybe like:

    if result.returncode != 0 and not "Please note that LAStools is not" in result.stdout.decode():
        raise AFwizardError(f"LASTools error: {result.stdout.decode()}")
    elif result.returncode != 0:
        logger.warning(f"LASTools warning: {result.stdout.decode()}")
        # no license found, switching to demo mode
        args.extend(["-demo"])
        with within_temporary_workspace():
            logger.info(
                f"Executing LASTools command line '{' '.join(executable + args)}'"
            )
            result = subprocess.run(
                executable + args,
                stdout=subprocess.PIPE,
                stderr=subprocess.STDOUT,
            )

I don't know if there is a more elegant way to catch the specific LAStools error..

@dokempf dokempf merged commit 8e1e853 into main Nov 14, 2025
3 checks passed
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