@dra2020/district-analytics 5.6.2 → 5.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +39 -23
- package/dist/cli.js.map +1 -1
- package/dist/district-analytics.js +11 -3
- package/dist/district-analytics.js.map +1 -1
- package/package.json +2 -2
|
@@ -156,7 +156,14 @@ class AnalyticsSession {
|
|
|
156
156
|
// Using the the data in the analytics session, calculate all the
|
|
157
157
|
// analytics & validations, saving/updating the individual test results.
|
|
158
158
|
analyzePlan(bLog = false, overridesJSON) {
|
|
159
|
+
// Return values:
|
|
160
|
+
// * true = everything good
|
|
161
|
+
// * false = should not have been called with empty plan
|
|
162
|
+
// * exception = exception caught and logged on the console
|
|
159
163
|
try {
|
|
164
|
+
// Guard against being handed a map w/o any precincts assigned
|
|
165
|
+
if (U.isObjectEmpty(this.plan._planByGeoID))
|
|
166
|
+
return false;
|
|
160
167
|
preprocess_1.doPreprocessData(this, bLog);
|
|
161
168
|
analyze_1.doAnalyzeDistricts(this, bLog);
|
|
162
169
|
analyze_1.doAnalyzePlan(this, bLog);
|
|
@@ -164,9 +171,10 @@ class AnalyticsSession {
|
|
|
164
171
|
this._scorecard = score_1.scorePlan(this, this._profile, bLog, overridesJSON);
|
|
165
172
|
results_1.doAnalyzePostProcessing(this, bLog);
|
|
166
173
|
}
|
|
167
|
-
catch (
|
|
168
|
-
console.log("Exception caught by analyzePlan()");
|
|
169
|
-
|
|
174
|
+
catch (e) {
|
|
175
|
+
console.log("Exception caught by analyzePlan().");
|
|
176
|
+
console.log(e.message);
|
|
177
|
+
throw e;
|
|
170
178
|
}
|
|
171
179
|
return true;
|
|
172
180
|
}
|