Handling Errors in OData Silverlight

3 posts, 0 answers
  1. Brent
    Brent avatar
    33 posts
    Member since:
    Jun 2010

    Posted 28 Aug 2012 Link to this post

     I'm converting my project over to silverlight 5 with OData 3.  Do you have any examples of how to handle errors being returned by the context via the WCF service.  I see you have an example in your documentation for WCF Ria but not Odata.  I'm probably missing something but I am trying to capture the error in a try catch block in the lambda being submitted on the background thread but I am not getting any specifics about the error.


    Dim myData As AspireWebWcfDataService.MyContext = ContextFactory.ObtainContext
    Dim newApp As New AspireWebWcfDataService.Application
    With newApp
        .ApplicationType = myNewWindow.NewProjectType
        '.ID = Guid.NewGuid
        .ProjectName = myNewWindow.NewApplicationName
        .RegionId = myNewWindow.NewRegion
        .IsArchived = False
        .LastUpdDate = Date.UtcNow
        'Add Submission Unit
        Dim newSubUnit As New AspireWebWcfDataService.SubmissionUnit
        newSubUnit.StartingPriority = 0
        'newSubUnit.ID = Guid.NewGuid
        newSubUnit.Name = "Original Submission"
        newSubUnit.CreateDate = System.DateTime.UtcNow
        newSubUnit.Type = "original"
        newSubUnit.FilingType = defaultFilingType
        newSubUnit.Status = "ssinprocess"
        newSubUnit.IntegrityCheckAlgorithm = defaultIntegrityType
        newSubUnit.LastUpdDate = Date.UtcNow
        myData.AddObject("Application", newApp)
        'myData.AddRelatedObject(newApp, "SubmissionUnits", newSubUnit)
                                        TryCast(c.AsyncState, AspireWebWcfDataService.MyContext).EndSaveChanges(c)
                                    Catch ex As Exception
                                    End Try
                                End Sub, myData)
    End With
  2. Brent
    Brent avatar
    33 posts
    Member since:
    Jun 2010

    Posted 29 Aug 2012 Link to this post

    I have found by opening the generated ContextService.vb class in the ServerProject and adding the following line of code that the InnerException being returned now shows a more detailed error description
    config.UseVerboseErrors = True
  3. DevCraft banner
  4. Viktor Zhivkov
    Viktor Zhivkov avatar
    290 posts

    Posted 30 Aug 2012 Link to this post

    Hi Brent,

    Client side implementation for OData Services in Silverlight is provided by Microsoft, not by Telerik OpenAccess.
    Silverlight.net official site has great tutorial how to work with OData and Silverlight. You can check it out and post in their or out forums if you have any questions.

    All the best,
    Viktor Zhivkov
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Back to Top