Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add named error codes and their corresponding messages #1150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ranger-turtle
Copy link

@ranger-turtle ranger-turtle commented Dec 10, 2023

There are two files representing FbErrorCodes static class.

I have taken codes and messages from https://ib-aid.com/download/docs/firebird-language-reference-2.5/fblangref25-appx02-sqlcodes.html.

Might close #1148 .

/// </summary>
public partial class FbErrorCodes
{
public static string GetMessage(int code) =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These messages are already part of exception message (from IscErrorMessages.cs).

/// <summary>
/// Error codes occuring in Firebird database management system.
///
/// Messages are taken from documentation at: https://ib-aid.com/download/docs/firebird-language-reference-2.5/fblangref25-appx02-sqlcodes.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather take it from Firebird sources. For completeness and copyright sake. Add also some simple steps how the file/data was created. Something rough like this is fine.

I would maybe even keep the "raw" naming like arith_except from https://github.com/FirebirdSQL/firebird/blob/65f0e8b4f1b346b436456bf74d954c2e8204076f/src/include/firebird/impl/msg/jrd.h#L2.

Maybe worth updating also IscErrorMessages and SqlStateMapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FbErrorCodes for easier checking of FbException.ErrorCode
2 participants