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

Why will an exception be thrown when the schema does not exist? #62

Open
sunxiaojian opened this issue Sep 19, 2022 · 2 comments
Open

Comments

@sunxiaojian
Copy link
Contributor

Whether an independent interface is provided to check whether the schema exists

Server:

image

client:

image

@sunxiaojian sunxiaojian changed the title Why will an exception be thrown when the schema does not exist? The client needs to identify whether the exception exists? Why will an exception be thrown when the schema does not exist? Sep 19, 2022
@humkum
Copy link
Collaborator

humkum commented Sep 19, 2022

I may not understand your request, but I found that if there didn't throw an exception. It would cause NPE in GetSchemaResponse constructor as follows:

public GetSchemaResponse(QualifiedName name, SchemaRecordInfo schemaRecordInfo) {
        this.subjectFullName = name.subjectFullName();
        this.schemaFullName = schemaRecordInfo.getSchema();
        this.recordId = CommonUtil.getSchemaRecordId(schemaRecordInfo.getSchemaId(),
            schemaRecordInfo.getVersion());
        this.idl = schemaRecordInfo.getIdl();
        this.dependency = schemaRecordInfo.getDependency();
        this.type = schemaRecordInfo.getType();
        this.fields = parse(idl);
    }

@ni-ze
Copy link
Contributor

ni-ze commented Apr 23, 2023

@humkum, IMO, If the result is empty, return null, or empty list is recommended. We will not construct a GetSchemaResponse with this constructor.

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

No branches or pull requests

3 participants