I would be useful to have 2 identifiers or variables available within a DLL to retreive the name of the calling script and also the line number where it was called.
This information could then be used by a DLL when they are printing an error message to indicate in what script/line dll call the error occured.
Another thing could be to have a traceback function that could give all the commands called within each other from the error line to the starting call.