Page MenuHomePhabricator

Make nonscalar field saves raise a more useful exception from LiskDAO
ClosedPublic

Authored by epriestley on Dec 6 2013, 1:26 AM.
Tags
None
Referenced Files
F13995749: D7725.id17466.diff
Wed, Oct 23, 3:10 PM
F13989681: D7725.id17443.diff
Mon, Oct 21, 10:19 PM
F13962273: D7725.id17466.diff
Tue, Oct 15, 9:08 AM
Unknown Object (File)
Sep 18 2024, 11:22 PM
Unknown Object (File)
Sep 18 2024, 11:06 PM
Unknown Object (File)
Sep 16 2024, 10:53 AM
Unknown Object (File)
Aug 29 2024, 7:19 AM
Unknown Object (File)
Aug 27 2024, 8:36 AM
Subscribers

Details

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}

Diff Detail

Branch
nonscalar
Lint
Lint Passed
Unit
Tests Passed