1

I am using the MVC Player in Composite C1.

On error all that is shown on the page is: [Error]

I have enabled debug="true" in the web.config - it has no effect.

How can I display detailed error messages on the page?

I can find nothing about this on Google.

Thanks

niico
  • 11,206
  • 23
  • 78
  • 161
  • I just found out if you make sure you are logged into the admin area for that site in a background tab - you are then shown detailed error messages! – niico Nov 04 '14 at 03:47

1 Answers1

3

C1 has a function to catch all errors and it writes out [Error] to the page with no other information.

What I do to find the error is open the C1 solution in Visual Studio, attach to the C1 process and then open the page. You will see where the error is as a result.

Also a further step is to put some extra logic in the function that handles the errors so you can have it logged somewhere useful.

An even further note - C1 often get's annoyed with non xhtml compliant characters. That has been the problem with the majority of our [Error] messages. Wrap things in CDATA or escape things like "&".

Hope that helps.

ryan1234
  • 7,237
  • 6
  • 25
  • 36
  • I need to get a full stack trace while this is running in a browser (on the server - not in Visual Studio). Is this possible? – niico Nov 08 '14 at 06:12
  • 1
    Sure. Look for the internal static XElement GetErrorDescriptionHtmlElement(Exception ex, string functionName) function in the Composite.Core.Xml namespace. That's one place/one way you can log errors. Can write to a file locally, write to SQL, etc. – ryan1234 Nov 10 '14 at 17:36
  • 1
    If you are logged into the C1 Console you will get Exception details when rendering the C1 Function. Also you will find details in the server log, accessible from the C1 Console. You can also attach a log viewer, see http://docs.composite.net/Configuration/Logging – mawtex Nov 14 '14 at 11:51