Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

how to debug repository operations? #87


User avatar
0
cicciottino created
  1. is there a way to get more details from an error happened in the repository layer ( for example getting the "inner excption") have i replace the .dll with the source code? or is there a way to expose more datails about the error? a i'm trying to add a "task" but i got a popoup(a javascript alert) whit the message: "An internal error occured during your request!" so i don't know how to investigate.

  2. i made some modifications on the model, later i've applyed some migrations to the db. i don't know what is the correct way to regenerate the db from the beginning and resync the migration: i did this:

  3. delete all the migration class

  4. removed the db

  5. add-migration "myFirstMigration"

  6. UpdateDatabase

i know this is not related with your awesome project, but can you tell me something about this second question as well? thanks a lot

i'm completely fall in love with your project and i'd like to learn a lot about it forgive me for my english.


3 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    Thanks. For exception handling, see <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/62#issuecomment-54001552">https://github.com/aspnetboilerplate/as ... t-54001552</a> You can add this class to handle all exceptions.

    For migrations,

    Never delete a migration if you applied to database. If you changed model (entities), always add a new migration and update database again.

    If you create a migration but not updated db yet, and changed model. In this time, you can delete migration and re-create, then update db.

    If you want to create db from zero, then delete db and run update-database command again.

    Have a nice day.

  • User Avatar
    0
    cicciottino created

    thanks a lot, it goes like a rocket :-)

    only a question for didactic purpose..

    the exception caught from this class(in my case) indicates that:

    Source = "Abp.Web.Api"
    Message = "MSDTC sul server 'OLSAITNB-01' non รจ disponibile."
    

    the problem is clear: the MSDTC on my machine was Disabled (Distributed Coordinator Transaction Services) ,so i enabled it and evertihing worked

    but, what is not clear for me is the source of the exception...

    i supposed that, if a problem was generated from something related to the "transaction", the exception should be generated from the "Data" layer (the repository for example, or at least, in the "application layer" where the UnitOfWok is managed, is it right?), <ins>anyway not from a "Adp.Web.Api" layer</ins>. can it be that the source indicated in the "source property" is not so accurate and is referred to the outer layer? or, i'm not understanding how it works?

    i aspected that the source of the exception was different

    i hope to have been clear enough to express my doubt.

  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    Exceptions are handled in Web API and MVC layers. So, they trigger EventBus events (<a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp.Web.Api/WebApi/Controllers/Filters/AbpExceptionFilterAttribute.cs#L43">https://github.com/aspnetboilerplate/as ... ute.cs#L43</a>). This is source of the event, not exception. Also, there is no need for source of the exception since Exception property provides all informations including stack trace.