def _load_manifest_json(err, package, expectation):
    raw_manifest_json = package.read('manifest.json')
    try:
        manifest_json = json.loads(raw_manifest_json)
    except ValueError:
        err.error(err_id=('main', 'test_package', 'parse_error'), error='Could not parse `manifest.json`.', description='The JSON parser was unable to parse the manifest.json file included with this add-on.', filename='manifest.json')
    else:
        err.save_resource('has_manifest_json', True, pushable=True)
        err.save_resource('manifest_json', manifest_json, pushable=True)
        err.detected_type = PACKAGE_EXTENSION
def _load_manifest_json(err, package, expectation):
    raw_manifest_json = package.read('manifest.json')
    try:
        manifest_json = json.loads(raw_manifest_json)
    except ValueError:
        err.error(err_id=('main', 'test_package', 'parse_error'), error='Could not parse `manifest.json`.', description='The JSON parser was unable to parse the manifest.json file included with this add-on.', filename='manifest.json')
    else:
        err.save_resource('has_manifest_json', True, pushable=True)
        err.save_resource('manifest_json', manifest_json, pushable=True)
        err.detected_type = PACKAGE_EXTENSION