How to use the http-status-codes.NOT_IMPLEMENTED function in http-status-codes

To help you get started, we’ve selected a few http-status-codes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / BotFramework-Emulator / packages / app / main / src / server / routes / emulator / handlers / removeUsers.ts View on Github external
//     members = members.filter(member => member.id !==
  // botEmulator.facilities.users.currentUserId && member.id !== botEmulator.botId);
  //     members = members.slice(0);
  //   }

  //   members.forEach(member => {
  //     req['conversation'].removeMember(member.id);
  //   });

  //   res.send(HttpStatus.OK);
  //   res.end();
  // } catch (err) {
  //   sendErrorResponse(req, res, next, err);
  // }

  res.send(HttpStatus.NOT_IMPLEMENTED);
  res.end();

  next();
}
github adobe / commerce-cif-magento / test / carts / deleteCartPaymentIT.js View on Github external
.then(function(res) {
                    expect(res).to.have.status(HttpStatus.NOT_IMPLEMENTED);
                    expect(res).to.be.json;
                    requiredFields.verifyErrorResponse(res.body);
                });
        });
github adobe / commerce-cif-magento / test / carts / deleteShippingMethodIT.js View on Github external
.then(function(res) {
                    expect(res).to.have.status(HttpStatus.NOT_IMPLEMENTED);
                    expect(res).to.be.json;
                    requiredFields.verifyErrorResponse(res.body);
                });
        });
github adobe / commerce-cif-magento / test / customer / postCustomerAuthIT.js View on Github external
.then(function (res) {
                    expect(res).to.be.json;
                    expect(res).to.have.status(HttpStatus.NOT_IMPLEMENTED);
                    expect(res.body.message).to.equal('NotImplementedError: Not implemented');
                });
        });
github adobe / commerce-cif-magento / test / carts / deletePaymentIT.js View on Github external
.then(function(res) {
                    expect(res).to.have.status(HttpStatus.NOT_IMPLEMENTED);
                    expect(res).to.be.json;
                    requiredFields.verifyErrorResponse(res.body);
                });
        });
github microsoft / BotFramework-Emulator / packages / app / main / src / server / routes / directLine / handlers / stream.spec.ts View on Github external
it('should send a 501', () => {
    const req: any = {};
    const res: any = {
      end: jest.fn(),
      send: jest.fn(),
    };
    const next = jest.fn();
    stream(req, res, next);

    expect(res.send).toHaveBeenCalledWith(HttpStatus.NOT_IMPLEMENTED);
    expect(res.end).toHaveBeenCalled();
    expect(next).toHaveBeenCalled();
  });
});
github microsoft / BotFramework-Emulator / packages / app / main / src / server / routes / emulator / handlers / removeUsers.spec.ts View on Github external
it('should send a 501', () => {
    const req: any = {};
    const res: any = {
      end: jest.fn(),
      send: jest.fn(),
    };
    const next = jest.fn();
    removeUsers(req, res, next);

    expect(res.send).toHaveBeenCalledWith(HttpStatus.NOT_IMPLEMENTED);
    expect(res.end).toHaveBeenCalled();
    expect(next).toHaveBeenCalled();
  });
});
github Azure / meta-azure-service-broker / lib / broker / v2 / api-handlers.js View on Github external
var emitEvent = function(broker, operation, params, processResponse, next) {
  var serviceId = params.service_id;
  var event = util.format('%s-%s', operation, serviceId);

  if (broker.listeners(event).length > 0) {
    log.info('Emitting event (%s) for (instanceId: %s).', event, params.instance_id);
    broker.emit(event, params, processResponse);
  } else {
    var errMsg = util.format('%s is not implemented for the service %s in this broker.', operation, serviceId);
    return common.handleServiceErrorEx(HttpStatus.NOT_IMPLEMENTED, errMsg, next);
  }
};
github microsoft / BotFramework-Emulator / packages / app / main / src / server / routes / directLine / handlers / stream.ts View on Github external
export function stream(req: Request, res: Response, next: Next): any {
  res.send(HttpStatus.NOT_IMPLEMENTED);
  res.end();

  next();
}
github adobe / commerce-cif-common / src / web-action-transformer / exception-mapper-transformer.js View on Github external
******************************************************************************/

'use strict';

const ITransformerPipelineAction = require('./transformer-pipeline').ITransformerPipelineAction;
const HttpStatusCodes = require('http-status-codes');
const ErrorResponse = require('@adobe/commerce-cif-model').ErrorResponse;

const ERROR_NAME_TO_STATUS_CODE = {
    'InvalidArgumentError': HttpStatusCodes.BAD_REQUEST,
    'MissingPropertyError': HttpStatusCodes.BAD_REQUEST,
    'CommerceServiceResourceNotFoundError': HttpStatusCodes.NOT_FOUND,
    'CommerceServiceBadRequestError': HttpStatusCodes.BAD_REQUEST,
    'CommerceServiceForbiddenError': HttpStatusCodes.FORBIDDEN,
    'CommerceServiceUnauthorizedError': HttpStatusCodes.UNAUTHORIZED,
    'NotImplementedError': HttpStatusCodes.NOT_IMPLEMENTED
};

/**
 * If the action ended with an error, this transformer maps the error to a status code and updates the response message.
 *
 * @extends ITransformerPipelineAction
 */
class ExceptionMapperTransformerPipelineAction extends ITransformerPipelineAction {
    transform(httpResponse, resultFromOwSequence) {
        if (!httpResponse.error) {
            return httpResponse;
        }

        let message;
        let reason;
        let type;