namespace SmoulderingBeachBall /// Provides the public facing functions of Smouldering Beach Ball. module Services = open System open SmoulderingBeachBall.Domain.DomainTypes open InternalServices.Validation open InternalServices.Drawing /// /// Creates an image using the specification provided by the ImageSpec. /// /// /// The image specification which describes how the image should look. /// let makeImage (spec: ImageSpec) = async { try printfn "[INFO.] Attempting to make image..." validateDimension spec.width validateDimension spec.height validateDirectory spec.filePath drawImage spec printfn "[SUCCESS] Image creation attempt complete." return () with | :? ArgumentException as ex -> printfn "%s" ex.Message | _ as ex -> printfn "%s" ex.Message }