This wiki is out of date, use the continuation of this wiki instead

Category:Errorcodes

From FenixWiki

Revision as of 23:23, 15 April 2007 by Sandman (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Errorcodes are constants that get generated by a function or another piece of code, when there occurs a malfunction. For example when you try the following code with the Network.DLL function NET_Connect():

if( (netid = NET_Connect("some-not-existing-server",1234)) < 0 )
    //error
else
    //success
end

The code NET_ERROR_CONNECTING is returned, which in fact is the value -20, which is less than 0, so we go into the //error section. Here we can for example output the error:

say("Error: " + NET_GetError(netid));

Or perform an action based on the type of error:

switch(netid)
    case NET_ERROR_CONNECTING:
        say("Could not connect to the specified server.");
    end
    case NET_ERROR_TOOMANYCONNS:
        say("There are too many connections open at this point.");
    end
end


Note that errorcodes do not necessarily have to be negative numbers; Network.DLL does this so the check of an error is just the check if the returned value is negative.


Below is a list of errorcodes generated by DLL's and others.


Articles in category "Errorcodes"

There are 2 articles in this category.

L

N

Personal tools