Skip to content

Fail/succeed instead of returning a status term from plx #75

@Seeker04

Description

@Seeker04

In some plx functions, we return a Status term currently that indicates the return value of the X funcions. Instead, it would be cleaner to simply fail the call with PL_fail in case of an X error.

We already have functions that do the latter.

Also, all X calls in plx functions should be double checked whether they all propagate errors if they fail, than the client-side code should also be double checked if it handles the error cases.

Update: instead of plain PL_fail calls, use ones like this:

return (foreign_t)PL_warning("xrr_query_extension: XRRQueryExtension() failed!");

and adjust the existing ones to this style (e.g. remove arity indicators, because PL_TRY with __func__ doesn't get them either). Or event better, create a new macro for the above pattern with __func__ to shorten this kind of error handling too...

Update: PL_warning does not simply return a failure, but also starts the tracer, effectively crashing plwm. So instead, we should log with something else (puts, printf, etc.) then return FALSE.

Update: success of build_list() is never checked. It should be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions