Homec4science

Make nonscalar field saves raise a more useful exception from LiskDAO

Authored by epriestley <git@epriestley.com> on Dec 7 2013, 00:47.

Description

Make nonscalar field saves raise a more useful exception from LiskDAO

Summary:
If you do something like this:

// Missing $user->getPHID()!
$object->setUserPHID($user)->save();

...you get a very unhelpful exception:

Expected a scalar or null for %s conversion. Query: %s

This doesn't give you any hints about what's wrong. Instead, provide a more useful exception:

Unable to insert or update object of class DifferentialRevision, field 'title' has a nonscalar value.

Test Plan: {F87614}

Reviewers: hach-que, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7725

Details

Committed
epriestley <git@epriestley.com>Dec 7 2013, 00:47
Pushed
aubortJan 31 2017, 17:16
Parents
rPHf69793184e0b: Fix over-matching of quoted text for message bodies beginning with "On..."
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH9d474452f9c5: Make nonscalar field saves raise a more useful exception from LiskDAO (authored by epriestley <git@epriestley.com>).Dec 7 2013, 00:47