Skip to content
  • Philip Chimento's avatar
    406b2d2d
    js: Introduce GErrorResult type · 406b2d2d
    Philip Chimento authored
    GErrorResult is a mozilla::Result type that can be used as a type-safe
    return type for fallible GNOME-platform operations. In the simplest
    case, where the function is equivalent to a C function with gboolean
    return type and GError** out parameter, use GErrorResult<> as the return
    type.
    
    To indicate success, return Ok{}, and to indicate failure, return
    Err(error) or Err(error.release()) if using AutoError.
    
    Refactors some functions in context.cpp and coverage.cpp to use
    GErrorResult and MOZ_TRY.
    406b2d2d
    js: Introduce GErrorResult type
    Philip Chimento authored
    GErrorResult is a mozilla::Result type that can be used as a type-safe
    return type for fallible GNOME-platform operations. In the simplest
    case, where the function is equivalent to a C function with gboolean
    return type and GError** out parameter, use GErrorResult<> as the return
    type.
    
    To indicate success, return Ok{}, and to indicate failure, return
    Err(error) or Err(error.release()) if using AutoError.
    
    Refactors some functions in context.cpp and coverage.cpp to use
    GErrorResult and MOZ_TRY.
Loading