Skip to content

Commit

Permalink
renamed to tryResolve
Browse files Browse the repository at this point in the history
  • Loading branch information
alxmrs committed Mar 4, 2020
1 parent 5703f02 commit ef36fdf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/tools/storage-key-recipe-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ export class StorageKeyRecipeResolver {
for (const recipe of this.runtime.context.allRecipes) {
const arc = this.runtime.newArc(this.getArcId(recipe), ramDiskStorageKeyPrefixForTest());
const opts = {errors: new Map<Recipe | RecipeComponent, string>()};
const resolved = await this.resolveOrNormalize(recipe, arc, opts);
const resolved = await this.tryResolve(recipe, arc, opts);
if (!resolved) {
throw Error(`Recipe ${recipe.name} failed to resolve:\n${[...opts.errors.values()].join('\n')}`);
}
this.createStoresForCreateHandles(resolved, arc);
resolved.normalize();
if (!resolved.isResolved()) {
throw Error(`Recipe ${resolved.name} did not properly resolve!\n${resolved.toString({showUnresolved: true})}`);
}
Expand All @@ -62,7 +61,7 @@ export class StorageKeyRecipeResolver {
* @param arc Arc is associated with input recipe
* @param opts contains `errors` map for reporting.
*/
async resolveOrNormalize(recipe: Recipe, arc: Arc, opts?: IsValidOptions): Promise<Recipe | null> {
async tryResolve(recipe: Recipe, arc: Arc, opts?: IsValidOptions): Promise<Recipe | null> {
const normalized = recipe.clone();
normalized.normalize();
if (normalized.isResolved()) return normalized;
Expand Down

0 comments on commit ef36fdf

Please sign in to comment.