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
Unknown Object (File)
Thu, Dec 5, 9:55 AM
Unknown Object (File)
Wed, Dec 4, 5:33 PM
Unknown Object (File)
Wed, Dec 4, 12:46 PM
Unknown Object (File)
Wed, Dec 4, 5:43 AM
Unknown Object (File)
Sat, Nov 23, 12:01 PM
Unknown Object (File)
Nov 15 2024, 9:37 AM
Unknown Object (File)
Nov 15 2024, 9:37 AM
Unknown Object (File)
Oct 23 2024, 3:10 PM
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

Lint
Lint Skipped
Unit
Tests Skipped