question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't use custom func as output

See original GitHub issue

Trying to use a custom function in Output I am getting the following exception:

 System.Exception: Cannot convert output type.
         at Fli.CE.ICommandContext`1.outputTypeMapping[a,a](ICommandContext`1 _, a output)
         at Fli.CE.ICommandContext`1.Output[a,a](ICommandContext`1 this, ICommandContext`1 context, a output)

My command:

    let! output =
                    cli {
                        Shell BASH
                        Command (opts.Value.Path)
                        WorkingDirectory(opts.Value.WorkingDir)
                        Output (Custom(Func<string,unit>(fun s -> ctx.GetLogger().LogInformation("log: {Message}", s) )
                        ))
                    }
                    |> Command.executeAsync
                    |> Async.StartAsTask

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
queilcommented, May 27, 2023

Thanks!

1reaction
CaptnCodrcommented, May 27, 2023

@queil Thanks for sharing. I was pretty sure that CustomOperations can’t share the same name, but I was wrong. This change comes in the next version + I amended some docs about this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handle and return errors from your custom function
If something goes wrong while your custom function runs, return an error to inform the user. If you have specific parameter requirements, such ......
Read more >
Why is Excel User Defined Function not working?
Sometimes a new module is not created, and the custom function code ends up in the wrong place, such as the code area...
Read more >
Custom function not returning any output
I'm trying to write a custom function but it isn't returning any output. Here's my code so far: Options[Alternate] = {AlternationType ...
Read more >
Applying a custom function to a data.table doesn't work, ...
tl,dr: My function seems to work, but then I lapply it and it doesn't. Is it the function or the lapplying? The data....
Read more >
Bug - Custom Function with Texture2D not working
Hi All, I'm trying to create a Custom Function Node with Texture2Ds. However, even the simplest function won't compile.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found