findShaderById method

  1. @override
Future<FindShaderResponse> findShaderById(
  1. String shaderId
)

Returns a FindShaderResponse for the shader with shaderId

Upon success a Shader object is provided and error is set to null

In case of error a ResponseError is set and no Shader is provided

Implementation

@override
Future<FindShaderResponse> findShaderById(String shaderId) {
  return catchSqlError<FindShaderResponse>(
      store.shaderDao.findById(shaderId).then((value) => value != null
          ? FindShaderResponse(shader: value)
          : FindShaderResponse(
              error: ResponseError.notFound(
                  message: 'Shader $shaderId not found',
                  context: contextShader,
                  target: shaderId))),
      (sqle) => FindShaderResponse(
          error: toResponseError(sqle,
              context: contextShader, target: shaderId)),
      options);
}