The result object
Whenever a filter is executed, it can always depend on an object named result in the context variable:
This result object has the following fields that your code can modify:
success: boolean, true by default. If set to false, this indicates to the engine that this filter does not wish normal processing to continue. The exact meaning depends on the type of filter, check the documentation for details.
errorMessage: string, empty by default. If you set success to false, we highly recommend you set errorMessage to some string that explains why. This will make debugging easier, and the error message will usually find its way back to the client -- again, that depends on the filter type.
errorCode: number, 0 by default. If you set success to false, you can also set errorCode to a number that will be sent back to the client, if the database protocol supports it.
closeConnection: boolean, false by default. If your logic wants to not just send an error back to the client, but actually terminate the connection, set this to true.
skip: boolean, false by default. If set to true, Gallium Data will simply drop this packet. Use this with caution -- dropping a result set row is usually OK, but dropping other kinds of packets can easily lead to a protocol error.
response: object, null by default. If you set this variable to a packet object, then the engine will forward that packet rather than the current packet. This is an advanced feature.