Skip to content

Improve error message for not existing column #24083

Description

@ocram1095

Hello guys,
while upgrading from 17.0.1.10.1 to 18.0.10.2 the following error message occured.

For context:
Occured error: "InvalidArgumentException: Column name \"iqmUw_flow_operations\".\"entity\" is NotNull, but has empty string or null as default."

It happens here:

throw new \InvalidArgumentException('Column name "' . $table->getName() . '"."' . $thing->getName() . '" is NotNull, but has empty string or null as default.');

After a look in the source code i found that the real reason for this error is a missing column not else.
I think it would be a good improvement to change this message to:

Column <column> with <type> in <table> not found

I was able to solve my mistake on my own, but it would certainly be helpful for the future if the message were more meaningful.

Thanks.

Marco

Activity

  1. kesselb commented on Nov 13, 2020

    @kesselb
    Contributor

    Sounds good to me. Mind to send a pull request?

    cc @nickvergessen @MorrisJobke

  2. added
    1. to developAccepted and waiting to be taken care of
    good first issueSmall tasks with clear documentation about how and in which place you need to fix things in.
    on Nov 13, 2020
  3. nickvergessen commented on Nov 13, 2020

    @nickvergessen
    Member

    already part of #24055

  4. added this to the Nextcloud 21 milestone on Nov 13, 2020
  5. nickvergessen commented on Nov 13, 2020

    @nickvergessen
    Member

    Or well my PR adjusts the error message a bit. The error happens before the column is created and in this case can't be created.

  6. added and removed
    1. to developAccepted and waiting to be taken care of
    good first issueSmall tasks with clear documentation about how and in which place you need to fix things in.
    on Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions