0

In an ASP.NET Angular Application, I have a particular method I am calling through angularJS to display some data from the database, but doing so, I get an error that states "An Error has occurred. Error detailed not Sent by the server." I confirmed it by debugging the method and discovered it works just fine and retrieves the data, but when it's time to display on the client, this happens. I have opened the browser console to check what is happening, but the error is not logged there either. If Only I can know what the problem is exactly, it would be so much better. See my code below;

C#

    public async Task<ListResultDto<GoodsRequestDto>> GetGoodsRequests()
    {
        var goodsRequests = await _goodsRequestRepo.GetAllListAsync();

        return new ListResultDto<GoodsRequestDto>(
            goodsRequests.MapTo<List<GoodsRequestDto>>()
            );
    }

AngularJS

           vm.loadGoodsRequests = function () {
                projectService.getGoodsRequests({}).success(function (result) {
                    vm.goodsRequests = result.items;
                });
            }

The HTML

         <div ng-if="vm.goodsRequests.length" ng-repeat="gr in vm.goodsRequests" class="classInfo-list-item col-md-6">
            <div class="classInfo-body">
                <h3 class="classInfo-title">
                    {{gr.categoryItem.name + "_" + gr.brand.name + "_" + gr.product.name | cut:true:50:' ...'}}
                </h3>
                <p class="classInfo-description">Quantity: {{gr.quantity}} {{gr.unit}}</p>
                <p class="classInfo-description">Payment Term: {{gr.paymentTerm}}</p>
                <div class="classInfo-registration-info">
                    {{gr.goodsQuotes.length}} Quote(s).
                </div>
                <div class="classInfo-actions">
                    <a class="btn btn-sm btn-info" ng-href="#/my-goods-requests/{{gr.id}}">@L("Details") <i class="fa fa-arrow-circle-right"></i></a>
                </div>
                <span ng-class="vm.statusClass(gr.statusString)" class="classInfo-date"> {{gr.statusString }}</span>
            </div>
        </div>

I used similar approach for other pages of the application and I didn't get any such problem. I don't know what I'm doing wrong and worst of all, I don't know the exact cause of the error.

Kacey Ezerioha
  • 1,068
  • 4
  • 22
  • 46

1 Answers1

-1

If your'e using the ASP.NET boilerplate, you can see the logs from "/host/maintenance". In this case you need to log in with the host admin.

g00glen00b
  • 41,995
  • 13
  • 95
  • 133
sujan maharjan
  • 119
  • 2
  • 3
  • 14