Skip to content
This repository has been archived by the owner on Mar 6, 2019. It is now read-only.

Commit

Permalink
Improved error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tmancey committed Jan 17, 2019
1 parent b180a1c commit 953939d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/ads_serve.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ bool AdsServe::ProcessCatalog(const std::string& json) {

LOG(INFO) << "Parsing catalog";

auto result = catalog.FromJson(json);
if (result != SUCCESS) {
if (!catalog.FromJson(json)) {
LOG(ERROR) << "Failed to parse catalog";

return false;
Expand Down
2 changes: 2 additions & 0 deletions src/bundle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ std::unique_ptr<BundleState> Bundle::GenerateFromCatalog(
}

if (heirarchy.empty()) {
LOG(ERROR) << "creativeSet segments are empty";
return nullptr;
}

Expand Down Expand Up @@ -160,6 +161,7 @@ std::unique_ptr<BundleState> Bundle::GenerateFromCatalog(
}

if (entries == 0) {
LOG(ERROR) << "creativeSet creatives are empty";
return nullptr;
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ void Client::OnStateLoaded(const Result result, const std::string& json) {

client_state_.reset(new ClientState());
} else {
auto result = FromJson(json);
if (result != SUCCESS) {
if (!FromJson(json)) {
return;
}

Expand Down

0 comments on commit 953939d

Please sign in to comment.