Skip to content

Engine: NPE instead of DatabaseMetadataException if the bucket is null during index creation #29

Closed

Description

@giastfader

ArcadeDB Version: 21.9.1-SNAPSHOT

JDK Version: N/A

OS: N/A

Expected behavior

DatabaseMetadataException should be raised

Actual behavior

NPE is raised, hiding the real exception and related error message

Steps to reproduce

I have no use case yet, but it's clear what happens looking at the code

    if (bucket == null)
      throw new DatabaseMetadataException(
          "Cannot create index on type '" + typeName + "' because the specified bucket '" + bucket.getName() + "' is not part of the type");

@lvca what the real message should be? Because if bucket is null something here is going very weird.

WDYT?

Activity

  1. lvca commented on Sep 3, 2021

    @lvca
    Member

    If bucket == null means the caller didn't provide a valid bucket, so the exception still makes sense, but I understand the responsibility should be on the caller. And the exception is accessing the bucket, so doesn't make much sense... Fixing it.

  2. self-assigned this
    on Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions