prod/native/extension/code/php_error.cpp (40 lines of code) (raw):
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "php_error.h"
#include <zend_errors.h>
const char* get_php_error_name( int code )
{
switch ( code )
{
case E_ERROR:
return "E_ERROR";
case E_WARNING:
return "E_WARNING";
case E_PARSE:
return "E_PARSE";
case E_NOTICE:
return "E_NOTICE";
case E_CORE_ERROR:
return "E_CORE_ERROR";
case E_CORE_WARNING:
return "E_CORE_WARNING";
case E_COMPILE_ERROR:
return "E_COMPILE_ERROR";
case E_COMPILE_WARNING:
return "E_COMPILE_WARNING";
case E_USER_ERROR:
return "E_USER_ERROR";
case E_USER_WARNING:
return "E_USER_WARNING";
case E_USER_NOTICE:
return "E_USER_NOTICE";
case E_STRICT:
return "E_STRICT";
case E_RECOVERABLE_ERROR:
return "E_RECOVERABLE_ERROR";
case E_DEPRECATED:
return "E_DEPRECATED";
case E_USER_DEPRECATED:
return "E_USER_DEPRECATED";
default:
return "UNDEFINED";
}
}