Removed functions giving error messages which say what to use instead

Issue #1327 resolved
created an issue

I think it might be nice if removed/replaced/renamed functions gave error messages which say what to use instead.

So instead of...


main.lua:1: attempt to call field 'newScreenshot' (a nil value)

it could be something like...


main.lua:1: has been replaced by

I know all of this information is in the changelog, but I'm guessing the error messages might still be helpful. And of course it wouldn't need to stay around forever, it could be removed in the next minor or revision release.

Comments (7)

  1. Alex Szpakowski

    I think my deprecation change is a bit different from this, since the former is only meant to work with APIs that still work rather than causing an error. For the latter, I guess we'd keep stubs of completely removed functions around which just call luaL_error.

  2. Bart van Strien

    To be fair, the issues is talking about replacements. I feel like there's little to no gain from a message saying "Hey, this doesn't exist any more!" as opposed to a message saying it's a nil value.

  3. hahawoo reporter

    I dunno, I think this might still be useful for functions which don't have a direct replacement, but similar functionality now exists elsewhere.

    Like for newScreenshot, even though createScreenshot isn't a direct replacement, the functionality of taking a screenshot is replaced by it, so I'd suggest that an error mesage pointing the API user to createScreenshot would be more useful than saying it's a nil value.

    I'm not sure but Shader:getExternVariable and Shader:hasUniform might also fall into this category.

  4. Log in to comment