anchor.diff:  
       ElementDeclarationResult result;
       try {
  -      result = await _resolvedClassResult(
  -        resolver,
  -        indexedAnnotation.element,
  -        toString(),
  -      );
  +      result = await _resolvedClassResult(resolver, indexedAnnotation.element);
       } on BuildError catch (buildError) {
         final annotationSource = indexedAnnotation.annotation.toSource();
  -      return BuildError.withoutContext('$buildError\n\n'
  -          'This error occurred processing the following annotation:\n'
  -          '$annotationSource');
  +      return BuildError.withoutContext(
  +        '$buildError while compiling $annotationSource: $this',
  +      );
       }
   
       var resolvedMetadata = _metadataFromAncestry(result.node);
  
positive.code:   );
    final result = await element.session.getResolvedLibraryByElement(library);
    if (result.state == ResultState.NOT_A_FILE) {
      // We don't have access to source information in summarized libraries,
      // but another build step will likely emit the root cause errors.
      throw BuildError.withoutContext(
        'Analysis errors in summarized library '
        '${library.source.fullName}',
      );
    }
    return result.getElementDeclaration(element);
  }
  
  abstract class AsyncBuildError {
  
negative.code: 
  Future<ElementDeclarationResult> _resolvedClassResult(
    Resolver resolver,
    Element element,
  ) async {
    AssetId assetId;
    try {
      assetId = await resolver.assetIdForElement(element);
    } on UnresolvableAssetException catch (_) {
      _throwInvalidSummaryError(element.source.fullName);
    }
    // A `part of` dart file is not a standalone dart library. Thus,
    // [library] is null when an error occurs in a `part of` dart file.
  