vocdoni / vocdoni-sdk

Vocdoni SDK for API
GNU Affero General Public License v3.0
13 stars 6 forks source link

Added raw data to `fetchElection` when function throws error #392

Closed marcvelmer closed 4 months ago

marcvelmer commented 4 months ago

Fixes #391

github-actions[bot] commented 4 months ago

size-limit report 📦

Path Size
dist/index.js 1.54 MB (+0.01% 🔺)
dist/index.mjs 1.54 MB (+0.01% 🔺)
dist/index.umd.js 1.55 MB (+0.01% 🔺)
elboletaire commented 4 months ago

I still feel like the return could be some kind of custom error type...

try {
  electionInfo = this.decryptMetadata(electionInformation, password);
  censusInfo = await this.buildCensus(electionInfo);
} catch (e) {
  throw new InvalidElectionError(e, electionId, electionInformation);
}